[thelist] php login problem with new site...

Justin Zachan justin at jazzmanagement.com.au
Tue Jun 22 01:03:00 CDT 2004


Hey there.

I only know basic php and I have put together a pretty simple login area
that will have a hard-coded login (client request).

If a user gets the username and password right it works fine.the problem is
if they get it wrong.

 

If an error is made, the page forwards to an error page which has the same
login php code (this works fine).

If a user then enters the correct password, the page does not forward to the
correct page (just stays on the login page). But if I refresh the page
(using refresh on the browser) and then type in the correct password it
works fine.

So somehow the page or code needs to refresh each time the user enters
submit.? Or something?

webpage: http://www.coogeesurfclub.com.au/develop/html/memberlogin.php 
username/password: justin/justin

The Code.


<?php if ($HTTP_POST_VARS["username"]=="") { ?>

then <html></html>...

 

<?php }else{ 

$username=$HTTP_POST_VARS["username"];

$password=$HTTP_POST_VARS["password"];

 

session_start();

if ($username=="justin" AND $password=="justin"){ $permission="yes";}

 

$username=$HTTP_POST_VARS["username"];

session_register("permission");   

session_register("username");  

 

if ($permission=="yes"){

 

$URL="http://www.coogeesurfclub.com.au/develop/html/patrols.php";

header ("Location: $URL");

?>

 

<?php }else{ 

 

$URL="http://www.coogeesurfclub.com.au/develop/html/errorlogin.php";

header ("Location: $URL");

?>

 

<?php } ?>

<?php } ?>

Cheers

Justin

 



More information about the thelist mailing list