i have a register and a log in page and it will not work. Here is the script for the register:
$myusername=$_POST['user'];
$mypassword=$_POST['pass'];
$cleanpwd=md5('$mypassword');
$myusername = stripslashes($myusername);
$cleanpwd = stripslashes($cleanpwd);
$myusername = mysql_real_escape_string($myusername);
$cleanpwd = mysql_real_escape_string($cleanpwd);
$sql="SELECT * FROM $tbl_name WHERE email='$myusername' and password='$cleanpwd'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1){
setcookie('username', '$myusername');
setcookie('password', '$cleanpwd');
session_register("myusername");
session_register("mypassword");
header('location:memberspage.php');
}
else {
echo "Wrong Username or Password";
}
?>
and the html for it is:
<table><td style='font-weight: bold; color: white; margin-left:auto; margin-right: auto;'><p>Class Manager Log-In</p>
<form name=login method=POST action="checklogin.php">User:<input type='text' name='user'><br />Pass:<input type='password' name='pass'><br /><input type='submit' value=Login class=emailbutton></form></td></table>
also the code for the register page is:
$user = $_POST['name'];
$password = $_POST['pass'];
$cleanpwd = md5('$password');
$zip = $_POST['zip'];
$last = $_POST['lname'];
$email = $_POST['email'];
$query = "INSERT INTO members (name, lname, password, email, zip) VALUES ('$user', '$last', '$cleanpwd', '$email', '$zip')";
$result = mysql_query($query)
or die('Could not send');
echo'Sent';
and it always says the username and password is wrong. But it isnt. Please help