/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php if($_POST['user']) { if(($_POST['user'] == "Username1") && ($_POST['pass'] == "Password1")) header("Location: http://the page to go to.com"); else if(($_POST['user'] == "User2") && ($_POST['pass'] == "Password2")) header("Location: http://the page to go to .com"); } else { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>php log in script</title> </head> <body> <br><br> <center> <font size= "6">Please Log In Below</font><br><br><br> <form action="<?=$PHP_SELF?>" method="post"> <p>Username: <input type="text" name="user"/> Password: <input type="password" name="pass"/> <input type= "submit" value= "Log In"/></p> </form> </center> </body> </html> <?php } ?>
URL: http://www.dynamicdrive.com/forums/showthread.php?t=28358
Comments
