RE: [PHP] validating form data...
| From: | Simba Pangeti | Date: | Sat, 20 Oct 2001 12:28:52 +0000 |
| Subject: | RE: [PHP] validating form data... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-71823@lists.php.net to get a copy of this message | ||
hi miles ,
this should work for you!!!!!!!!!
if (!eregi("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$",
$email))
{
echo " <B>Please go back and fill in a VALID e-mail address</B>
exit;
}
thanks
simba
-----Original Message-----
From: Miles Thompson [mailto:milesthompson@ns.sympatico.ca]
Sent: 22 October 2001 14:36
To: php-general@lists.php.net
Subject: Re: [PHP] validating form data...
Divide and conquer ....
Have you tried it one function at a time -- e.g.
if (email_is_valid($Email)
{
do stuff ...
also,
what values do these tests return?
have you echoed the values?
HTH - Miles
At 02:07 PM 10/22/01 +0200, Toke Herkild wrote:
>I've made a script which ought to validate if there is data in the fields
or
>not... but it doesn't seem to work...
>
>the validation is following:
>if ((email_is_valid($Email)) and ($Name != "") and ($Message != "")){
> do stuff ...
>}
>
>But even if I submit an empty form it executes "do stuf..."
>I have tried to put an empty space into the $Name and $Message test but
that
>doesn't seem to do any difference either...
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>For additional commands, e-mail: php-general-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.282 / Virus Database: 150 - Release Date: 25/09/01
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.282 / Virus Database: 150 - Release Date: 25/09/01