I have a small program that my friend wrote for me. What it does is when a user goes to the url www.anysite.com/users.php?user=email@aol.com it will take that email address out of the url, check a .txt file to see if the email address is in there. If the email is contained in the .txt file, it is put it into a variable for use later on in the coding.
There is a problem however, my friend wrote it so that the emails in the .txt file would be separated by only a comma, I need it to by separated by new lines. But, the way he wrote it, if you have more than one email address in the text file, it wont read it. I do not know why. For my application, I will need to have hundreds of emails in the .txt file.
Here is the code, if someone would be so kind as to tell me how to make the program read an email on a new line instead of being separated by a comma, it would be greatly appreciated.
Thanks everyone!
<?
$handle = fopen('email.txt','r');
$data = fread($handle,999);
fclose($handle);
$data = explode(',',$data);
for ($i=0;$i<count($data);$i++)
{
if ($data[$i] != $user)
exit ("No account was found");
}
?>