Click to See Complete Forum and Search --> : help


micjohnson
07-14-2003, 10:27 PM
hey i just got my first site that allows php and I want a simp login script how do i go about doing that?

Khalid Ali
07-15-2003, 12:28 AM
2 possible ways you can do it..either use cookies or use database authentication...for cookies you really do not need PHP for db yes you do..;)

pyro
07-15-2003, 07:50 AM
This might help you. It's not great, but it's a start: http://forums.webdeveloper.com/showthread.php?s=&threadid=9950#post51430

micjohnson
07-15-2003, 06:37 PM
thanks that helps alot but I am still having trouble with this one part <?PHP

# Change the below lines to the results that makepass.php gave you
#
$user = 'yourencryptedusername';
$pass = 'yourencryptedpassword';
#
# Change the above lines to the results that makepass.php gave you

if(md5($_POST['username']) == $user && md5($_POST['password']) == $pass)
{
setcookie ("verified", true);
header ("Location:http://www.yoursite.com/dir/page.htm");
}
else
{
echo ("Incorrect Password");
}
?>

what should the header thing be??
header ("Location:http://www.yoursite.com/dir/page.htm");

pyro
07-15-2003, 10:37 PM
the header is the page it goes to once you log in...

micjohnson
07-16-2003, 02:35 AM
Thanks!! works great

pyro
07-16-2003, 07:03 AM
You're welcome... :)