hi,
does anyone know a secure way to login to another page with username and password. i found numerous on google but i don't know which one is good. if anyone has any good source codes please help.
What do you mean another page?
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
Set session variables on login, and then on "members only" pages, check to see if the variable exists. If not, deny access.
In short:
<?php
if(empty($_SESSION['username'])) {
echo "Please login.";
}
else {
echo "You are logged in as: " . $_SESSION['username'];
//members only content...
//members only content...
}
?>
Andrieux
Junior Poster in Training
61 posts since Jan 2009
Reputation Points: 10
Solved Threads: 4