HI,
I just started using PHP. I made a login form, when executed it opens a text file and checks line by line to see if that persons username is listed. It is not working however. I used the strcmp() function.
I am used to PERL where sometimes you had to use the chomp($var);
I am posting my code here, if you see the problem please let me know. $name comes from the text file and $username comes from teh form.
<?
$fp = fopen("reguser.txt", "r");
while (!feof($fp))
{
$name = fgets($fp, 30);
if (strcmp($name, $username) == 0)
{
echo "username axcepted!";
exit;
}
else
{
echo "not excepted";
}
}
fclose($fp);
?>
I realize it is probibly easier to make a MYSQL database but I am doing to try to understand the language better.
thanks,
Jay Pedersen