So when I login, with the correct ID and password it just shows up as "Wrong ID or Password". Not sure why this is. Have I made a typo? or is it something else? Please help...thank you. Just thought i say that when registering the password is crypted and stored using "crypt". Do i need to define that when defining $pw - is that why it isn't working?
UPDATE = I used this tutorial/website
process_login.php
<?php
$host="localhost"; // Host name
$username="*******"; // Mysql username
$password="*******"; // Mysql password
$db_name="*******"; // Database name
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// username and password sent from form
$id=$_POST['ID'];
$pw=$_POST['Password'];
// To protect MySQL injection (more detail about MySQL injection)
$id = stripslashes($id);
$pw = stripslashes($pw);
$id = mysql_real_escape_string($id);
$pw = mysql_real_escape_string($pw);
$sql="SELECT * FROM User WHERE ID='$id' and Password='$pw'";
$result=mysql_query($sql);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $id and $pw, table row must be 1 row
if($count==1){
$result=mysql_fetch_array($result);
$st = $result['Status'];
//page link on the basis of user Status you can add more condition on the basis of ur roles in db
if($st == '0'){
$link = 'menu_user.php';
}
elseif($st == '1'){
$link = 'menu_staff.php';
}
elseif($st == '2'){
$link = 'menu_admin.php';
}
// session Register $id, $pw and redirect
$_SESSION["ID"] = $id;
$_SESSION["Password"] = $pw;
$_SESSION["Status"] = $st;
header("Location: ".$link."");
}
else {
echo "Wrong ID or Password";
echo"<META HTTP-EQUIV='Refresh' Content='2; URL=http://******/index.php'>";
}
?>