chriscloyd Posted November 21, 2006 Share Posted November 21, 2006 my login form is not working hmm and it should be i dont see anythign wrong with it can someoen help meit keeps sending me to the ?page=login[code]<?phpsession_start();include("db.php");if(isset($_POST['username'])){ $username = $_POST['username']; $password = $_POST['password']; if ($username == NULL){ $error = 1; $reason = "You did not enter a username"; } else { $error = 0; } if ($password == NULL){ $error = 1; $reason = "You did not enter a username<br>"; } else { $error = 0; $password = md5($password); } if ($error = 0){ $check_info = mysql_query("SELECT * FROM users WHERE username = '$username' "); $info = mysql_fetch_assoc($check_info); if($info > 0){ if($info['password'] == $password){ $_SESSION['sirix'] = $username; } else { $error = 1; $reason = "Your password and the account password did not match!"; } if($info['level'] == "admin"){ $_SESSION['sirixadmin'] = $username; } } header("Location: index.php?page=profile"); } else { header("Location: index.php?page=login&reason=".$reason); }}?>[/code] Link to comment Share on other sites More sharing options...
Recommended Posts