Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using Sessions to Make a Login Script
12-21-2009, 09:53 AM
Post: #1
Using Sessions to Make a Login Script
<?
require ("config.php");
session_start();
if ((!$username) || (!$password)) {
echo '<form name=login method=post action="">
user:<input type=text name=username><br>
pass:<input type=text name=password><br>
<input type=submit value=go>
</form>';
}
else {
if ($username=="$uname") {
session_register("username");
session_register("password");
echo "user is $uname, and password is $pword
<br> <a href=\"?m=1\" >unreg</a>";
}
else echo "nope";
}
if ($m==1) {
session_unregister("username");
session_unregister("password");
}
?>
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)