PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am slowly learning php on my own. I need to know what I can do to check the name and password entered in the text boxes against the records in the text file. Then when I have match, the form will be hidden from view.
If there is no match, write the name and password to the text file.
Why is it that I always seem to run well meaning idiots when I ask a simple question?
Are you the class clown?
Do you think I just whipped that code out of thin air on my own? No. Actually, it is a combination of stuff I've already found on php.net and elsewhere.
I would prefer that if you're going to reply to a post with an asenine response, please keep it to yourself.
Please feel free to read the first post of this thread.
When the submit button is pressed, what has to follow to pass the entered items on to the next code so the items can be verified through the array?
$lines = file('test.txt');
foreach ($lines as $line_num => $line)
{
print "<font color=red>Line #{$line_num}</font> : " . $line . "<br />\n";
$arr=explode(",",$line);
if ($arr == $userid) {
userid is a match
}
if($arr == $password){
password is a match
}
if (userid == true AND password == true){
hide form
}
else{
dont do anything
}
}
I am sure there is a more elegant way but this might help you develop it .