"Francisco Vaucher" <[EMAIL PROTECTED]> wrote in message
news:3B966ABC166BAF47ACBF4639003B11AC848AE7@;exchange.adtarg.com...
>
> Hi to all (again ;-)
>
> I need one or more PHP functions to handle a form input.
>
> i.e. you write: [EMAIL PROTECTED]
>
> I have to check that after the '@' comes 'test.com'. I think this is easy,

Something like this?

$address = explode( '@', $_POST['email'] );
if ( $address[1] == 'test.com' )
    echo 'Valid';
else
    echo 'Not valid';

or:

if ( preg_match( '/.*@test\.com$/', $_POST['email'] ) )
    echo 'Valid';
else
    echo 'Not valid';

$_POST['email'] contains the email address, submitted by the form.

HTH
Erwin


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to