PHP script to check if email exists in a text.txt file
Posted: Tue Nov 21, 2006 9:14 pm
feyd | Please use
The problem is that is goes to the else statement all the times so I think I didn't do it right. Any idea?
Thanks
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi guys,
How do I check an input email from user to a text.txt file containing the list of email seperated by comma
emaillist.txtexample of email:Code: Select all
1234@yaho.com,
asdf@asgb.com,
a24t@asf.com,
423yg@yasdf.comCode: Select all
<?php
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$email = strip_tags($email);
$str = strtoupper(file_get_contents("emaillist.txt"));
if (strpos($str, strtoupper($email)))
{
// stuff here
mail($email, $subject, $message);
}
else
{
// stuff here
mail($email, $subject, $message);
}
}
?>Thanks
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]