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. Link to comment https://forums.phpfreaks.com/topic/81024-solved-header-is-not-working/ 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. Link to comment https://forums.phpfreaks.com/topic/81024-solved-header-is-not-working/#findComment-411081 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. Link to comment https://forums.phpfreaks.com/topic/81024-solved-header-is-not-working/#findComment-411085 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.