Re: Issue with Quick Email validation
| From: | NetEmp | Date: | Fri, 11 Mar 2011 08:36:14 +0000 |
| Subject: | Re: Issue with Quick Email validation | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-311772@lists.php.net to get a copy of this message | ||
Great Going Bob!
Wishing you Lots of Fun ahead!
Cheers
NetEmp
On Fri, Mar 11, 2011 at 12:54 AM, <robert@myself.com> wrote:
> Yep, new to programming and starting with php
> -taken classes but don't have the experience yet
>
> Not asking for complete mail addresses probably work best in most
> companies, but we're so used to typing our complete address that I would
> need to have a control and removal of domain -only to add again for sending
> the mail.
>
> Yes the first part of this already has a separate account validation, it
> also logs a request into our internal support system.
> Naturally if a external mail address is filled in there will be no request
> created, and I could have stopped the script there.
> This way I can stop use of external mail, while a contractor that not yet
> have a account in our logging system will still be able to send a Email
> request
>
>
> At a later stage I might add email validation and even pick up details
> such as phone numbers and titles, but for now this little extra piece was
> sufficient
>
> Thanks again,
> Bob
>
> -----Original Message-----
> From: NetEmp <net.served@gmail.com>
> To: RQuadling@googlemail.com
> Cc: Richard Quadling <rquadling@gmail.com>; robert@myself.com;
> louis.huppenbauer@gmail.com; php-general@lists.php.net
> Sent: Thu, Mar 10, 2011 3:46 pm
> Subject: Re: [PHP] Issue with Quick Email validation
>
> Agreed with the method suggested by Richard here, this is surely a safer
> way.
>
> @Robert - are you a newbie to PHP or also to web programing.. or as a
> matter of fact to programing..
>
> Just to share that validating user's input is always advisable, esp. in
> the web world. Thus, even if you use the method suggested by Richard, but I
> shall then also advise you to apply proper validations at the input (like
> permissible characters, maximum length allowed etc..)
>
> Cheers
>
> On Thu, Mar 10, 2011 at 5:19 PM, Richard Quadling <rquadling@gmail.com>wrote:
>
>> 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
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>