| | |
check text file for email address... need help
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jun 2008
Posts: 62
Reputation:
Solved Threads: 3
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
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
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 Syntax (Toggle Plain Text)
<?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
There are alot of people smarter than me, BUT at least I try to be of some help. Of coarse I'm not perfect, I need help too.
•
•
•
•
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 Syntax (Toggle Plain Text)
<?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
If you do use regular expressions such as preg_match() then you need to make sure the first argument is a regular expression.
The regular expression should start and end with a delimiter. The delimiter must not be alpha-numeric or a backslash as mentioned in the error message.
Examples:
PHP Syntax (Toggle Plain Text)
"/".$email."/"
or
PHP Syntax (Toggle Plain Text)
"|".$email."|"
You will also want to make sure you escape any characters that have meaning in when in a regular expression, from the email.
eg:
PHP Syntax (Toggle Plain Text)
"|".preg_quote($email, '|')."|"
http://www.php.net/manual/en/function.preg-quote.php
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
Similar Threads
- send email with attachment (PHP)
- Help with handling encoding to display Japanese text (PHP)
- form page to send an email (Site Layout and Usability)
- how to export results from form as txt file (ASP)
- need help how to produce a txt file after email being sent in ASP (ASP)
- File Attachment Small Problem (PHP)
- Edit email form replies to not show blank answers (HTML and CSS)
- creating the text file that a form sends to email (HTML and CSS)
- Check existing users in the database (ASP)
- HighJackThis File Log, Help Needed. (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: PHP and creating a new system
- Next Thread: code for downloading as doc file
| Thread Tools | Search this Thread |
ajax apache api array basics beginner binary broken cakephp checkbox class cms code codingproblem combobox cron curl database date display domain dynamic echo email error file files folder form format forms function functions google href htaccess html image include insert interactive ip java javascript joomla js limit link load login mail malfunctioning menu mlm mobile multiple mysql nodes oop outofmemmory paging parse paypal pdf php problem procedure query radio ram random recursion reference remote return script search server sessions sms source space sql syntax system table tutorial unset up-to-date update upload url validation validator variable video web webapplications websitecontactform youtube






