One More
Posted: Fri Apr 16, 2004 6:58 pm
i have got one more problem. cant make out where the mistake is !!
here are the two scripts that i used:
and:
it says invalid password though i have typed the correct password !!
no matter what i change..it is not workin.
here are the two scripts that i used:
Code: Select all
<html>
<head>
<title>User Login</title>
</head>
<body>
<div>
<form action="loginuser.php" method="post">
<b>UserID: </b><input type="text" name="userid" length="8" size="8"><br>
<b>Password: </b><input type="password" name="password" length="8" size="8"><br><br>
<input type="reset" value="Reset">
<input type="submit" value="Login">
</div>
</body>
</html>Code: Select all
<?php
session_start();
if($fp=fopen("$_POSTїuserid].txt","r"))
{
$check1=fgets($fp);
$check2=fgets($fp);
$name=fgets($fp);
fclose($fp);
if($check2==$_POSTїpassword])
{
$_SESSIONї'name']=$name;
print("You are now logged in as <b>$_POSTїuserid]</b>.");
}
else
{
die("Invalid password.");
}
}
else
{
die("UserID does not exist.");
}
?>no matter what i change..it is not workin.