hey there (again)..🙂
<?php
include("common.php");
if(!($link_id = mysql_connect($Host, $User, $Pass))) die(mysql_erorr());
mysql_select_db($D😎;
$Name = addslashes($POST['Name']);
$Password = md5($POST['Password']);
//SELECT * FROM your_table WHERE Name='$Name' and Password='$Password'
$sql = "SELECT ID FROM user $Table WHERE Name='$Name' AND Password='$Password' LIMIT 1";
$result = mysql_query($sql) or die(mysql_error());
//This is were we check the result.
if(mysql_num_rows($result) == 1) {
/Here we set a cookie that tells if the user has logged in and set it to last for a day. The cookie is used on the members page to check
If they cookie is there they can see the page, if not they can't./
setcookie("LoggedIn", "TRUE", time()+(3600 * 24));
/*You could also do the header() here just like I explained before.*/
echo "Continue to the <a href=members.php>Members</a> page.";
} else {
echo "Login failure";
}
?>