In reply to: Heh... -- Inuyasha 20:44:41 12-07-2008
Just as an example... Posted by: Inuyasha 20:50:51 12-07-2008 |
This is part of the login system of my old forum software:
//Check if they are logged in or not.
if( isset($_COOKIE['username']) AND isset($_COOKIE['password']) ){
//Select the user from the database
$user= mysql_real_escape_string($_COOKIE['username']);
$pass= mysql_real_escape_string($_COOKIE['password']);
$login_query = mysql_query( "SELECT * FROM `iptbb_users` WHERE `username` = '$user' AND `password` = '$pass' " );
$login_rows = mysql_num_rows($login_query);
if($login_rows > 0){
//If it matches, they are logged in.
}
} else {
//They have no cookies set
}