Hi all. I am having a little trouble trying to get a small script to work. What I am trying to do is create a page to use with DADA mail mailing list software.
I would like this page to search through the DADA mail text file of email address and find if an email specified with a GET variable is in the file.
With one option selected, it would be able to delete it or with another option, if not in the list, add an email to it. I think I can figure out the last one, but I am having difficulties with searching the file. Any suggestions.
Here's what I tried
<?php
$email = $_GET['email'];
$file = "../dada_files/pomona.list";
$fh = fopen($file, "r");
$string = fread($fh, filesize($file));
fclose($fh);
preg_match_all($email, $string, $out);
echo $out[0][0] . ", " . $out[0][1] . "\n";
?>
and I got this error:
Warning: preg_match_all() [function.preg-match-all]: Delimiter must not be alphanumeric or backslash in /read_test.php on line 10