Forum Moderators: coopster

Message Too Old, No Replies

Little header location problem

         

bysonary

12:46 pm on Jun 4, 2007 (gmt 0)

10+ Year Member



hi i have thw following code in an authentication script, this is just a snippet of the code.


if(mysql_num_rows($result) == 1)
{
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$_SESSION['username'] = $row['uname'];
$_SESSION['Authenticated'] = true;
header('Location: logs.php');
}
else
{
[b]header('Location: http://example.co.uk/bin/loginform.php?e=Invalid username and password'); //PROBLEM HERE[/b]
}

the bold chunk of the code doesn't appear to be functioning as I had hoped, for example I get this in firefox.

The requested URL /bin/http@//example.co.uk/bin/loginform.php was not found on this server.

dont have a clue what that /bin/http@ is all about, anyone help me out here?

[edited by: eelixduppy at 1:02 pm (utc) on June 4, 2007]
[edit reason] example.co.uk (delinks) [/edit]

phparion

1:53 pm on Jun 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



header('Location: http://example.co.uk/bin/loginform.php?e=NoSpacesHere');

did you try something like the above?

barns101

1:53 pm on Jun 4, 2007 (gmt 0)

10+ Year Member



My only guess is that the spaces in the error message variable are causing the problem.

Try URL encoding the error message:


else
{
header('Location: http://example.co.uk/bin/loginform.php?e=Invalid%20username%20and%20password'); //PROBLEM HERE
}