Jump to content

[SOLVED] Header is not working


thefollower

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.