If the regexp matches, it is a valid email, so you need ! in front of it.
dan radom wrote:
>I've got a form that's posted to a php page where I'm attempting to validate a field
>contains a valid email address. The eregi below seems to be totally ignored...
>
> if (eregi("^[a-z0-9\._-]+@[a
My main cnocern at this point is that the eregi is being totally ignored. I just want
to make sure the email address is in a valid format, not that it is a valid email
address. I'll look at validEmailFormat as well, but I don't understand why it's not
even being examined.
dan
* Justin Fren
Dan,
I'll give you a little piece of advise that was given to me a little while
back on this list:
Go to http://www.killersoft.com/ and grab a copy of the validateEmailFormat
program.
PHP4 translation of Jeffrey E.F. Friedl's definitive Email Regex Program
from O'Reilly's Mastering Regular Exp
I've got a form that's posted to a php page where I'm attempting to validate a field
contains a valid email address. The eregi below seems to be totally ignored...
if (eregi("^[a-z0-9\._-]+@[a-z0-9\._-]+$", $emp_email)) {
echo "please enter a valid email address";
the rest seems ok to me, if you search for files with e.g hello_.jpg as
name
"Michael Virnstein" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> eregi('_[0-9]{4}.jpg$', $file_name)
>
> should be
>
> eregi('_[0-9]{4}\.jpg$', $file_name)
>
> . is a spci
eregi('_[0-9]{4}.jpg$', $file_name)
should be
eregi('_[0-9]{4}\.jpg$', $file_name)
. is a spcial character(means every character) and has to be backslashed if
you want it's normal meaning
"Jas" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I must be
I must be doing something wrong, for that solution did not work.
"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> jas wrote:
> >
> > // second selection for main image on main page
> > $dir_name = "/path/to/images/directory/";
> > $dir = opendi
jas wrote:
>
> // second selection for main image on main page
> $dir_name = "/path/to/images/directory/";
> $dir = opendir($dir_name);
> $file_lost .= "
> ";
> while ($file_names = readdir($dir)) {
> if ($file_names != "." && $file_names !=".." && eregi('_[0-9]{4}.jpg$',
> $file_name)) {
>
// second selection for main image on main page
$dir_name = "/path/to/images/directory/";
$dir = opendir($dir_name);
$file_lost .= "
";
while ($file_names = readdir($dir)) {
if ($file_names != "." && $file_names !=".." && eregi('_[0-9]{4}.jpg$',
$file_name)) {
$file_lost .= "$file_names";
}
9 matches
Mail list logo