note 71910 added to function.eregi
| From: | webmaster at galofre dot net | Date: | Fri, 22 Dec 2006 05:36:20 +0000 |
| Subject: | note 71910 added to function.eregi | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-120844@lists.php.net to get a copy of this message | ||
I am using the eregi function but when combine with the explode function, it returns an invalid
email. Even when the email is correct. Here is my code:
if(empty($profile)) {
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = "quickForm.php?empty=true&dl=$newsletter";
header("Location: http://$host$uri/$extra");
exit;
} else {
$tmp = explode("\n", $profile);
$firstname = $tmp[0];
$lastname = $tmp[1];
$Street = $tmp[2];
$City = $tmp[3];
$State = $tmp[4];
$Zip = $tmp[5];
$Country = $tmp[6];
$Email = $tmp[7];
$Phone = $tmp[8];
// do some basic error checking
if(!empty($Email)) { // if there was some email address provided, then vet it
if (!eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$", $Email)) {
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = "quickForm.php?send=no&dl=$newsletter";
header("Location: http://$host$uri/$extra");
exit;
}
}
Any ideas how to prevent this?
----
Server IP: 64.71.164.2
Probable Submitter: 24.21.179.161
----
Manual Page -- http://www.php.net/manual/en/function.eregi.php
Edit -- https://master.php.net/note/edit/71910
Del: integrated -- https://master.php.net/note/delete/71910/integrated
Del: useless -- https://master.php.net/note/delete/71910/useless
Del: bad code -- https://master.php.net/note/delete/71910/bad+code
Del: spam -- https://master.php.net/note/delete/71910/spam
Del: non-english -- https://master.php.net/note/delete/71910/non-english
Del: in docs -- https://master.php.net/note/delete/71910/in+docs
Del: other reasons-- https://master.php.net/note/delete/71910
Reject -- https://master.php.net/note/reject/71910
Search -- https://master.php.net/manage/user-notes.php