thefollower Posted December 10, 2007 Share Posted December 10, 2007 My header for redirecting users is not working.. the query with it works so its entering into the correct if statement yet it just won't header... no idea why either.. <?php if (isset($_POST['Login'])) { //set input from user into these variables $Username = mysql_real_escape_string($_POST['Username']); $Password = mysql_real_escape_string($_POST['Password']); $Date = date("Y-m-d H:i:s",time()); //check if username exists $chkLogin = mysql_query("SELECT * FROM `userregistration` WHERE `Username` = '$Username' AND Password = '$Password'"); if (mysql_num_rows($chkLogin) < 1) { $InsetLog = mysql_query("INSERT INTO userlogs (UserID, Log, `Date`) VALUES ('0', '$Username failed to logged in.', '$Date')") or die(mysql_error()); header("Location: login.php?failed"); } ?> When i get the login wrong it just takes me back to login.php rather than login.php?failed I have used this Get idea before without a value carried with it like failed=1 it usually works without a value carried with it. Quote Link to comment Share on other sites More sharing options...
JacobYaYa Posted December 10, 2007 Share Posted December 10, 2007 I just tried it with header('Location: http://www.phpfreaks.com?aids') and it worked...maybe doesn't work for relative path. Quote Link to comment Share on other sites More sharing options...
trq Posted December 10, 2007 Share Posted December 10, 2007 According to http specs, Location requires a url. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.