Re: Issue with Quick Email validation
| From: | Richard Quadling | Date: | Thu, 10 Mar 2011 11:49:19 +0000 |
| Subject: | Re: Issue with Quick Email validation | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-311762@lists.php.net to get a copy of this message | ||
On 10 March 2011 11:07, <robert@myself.com> wrote:
> Thank you, that did get me past that part!
>
> Had also to put in else statement to call Email function, without doing so the mail was sent
> even though giving error
>
> Robert
>
>
>
>
>
>
>
> -----Original Message-----
> From: Louis Huppenbauer <louis.huppenbauer@gmail.com>
> To: robert@myself.com
> Cc: php-general@lists.php.net
> Sent: Thu, Mar 10, 2011 11:38 am
> Subject: Re: [PHP] Issue with Quick Email validation
>
>
> try != instead of ==, that should do the trick.
>
>
>
> 2011/3/10 <robert@myself.com>:
>
>> Hi,
>
>> I'm newbie to PHP and this list, possible not a new question so forgive me if
>
> it's a repeat
>
>> I have a form where I want the submitter Email ID to only be from one domain
>
>>
>
>> Here's the part I'm having issues with
>
>>
>
>> $domain = explode(
>> "@", $who);
>
>> if ( $domain[1] == "company.com") {
>
>> echo $domain[1];
>
>> echo("<h3>Email
>> invalid.</h3>");
>
>> exit;
>
>> }
>
>>
>
>> First Echo is just for me to check
>
>> I type in a correct Email ID, say me@company.com
>
>>
>
>> The return of this is:
>
>>
>
>> company.com
>
>> Email invalid.
>> As far as I can see this if statement should not fall in, what am I missing?
Why bother asking for the entire address? Just ask for the name part
and display the domain name on the form?
<label for="email">Enter your email address: <input type="text"
name="email" id="email" />@company.com</label>
sort of thing.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY