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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.