Re: Issue with Quick Email validation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Great Going Bob!

Wishing you Lots of Fun ahead!

Cheers

NetEmp

On Fri, Mar 11, 2011 at 12:54 AM, <robert@xxxxxxxxxx> 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@xxxxxxxxx>
> To: RQuadling@xxxxxxxxxxxxxx
> Cc: Richard Quadling <rquadling@xxxxxxxxx>; robert@xxxxxxxxxx;
> louis.huppenbauer@xxxxxxxxx; php-general@xxxxxxxxxxxxx
> Sent: Thu, Mar 10, 2011 3:46 pm
> Subject: Re:  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@xxxxxxxxx>wrote:
>
>>  On 10 March 2011 11:07,  <robert@xxxxxxxxxx> 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@xxxxxxxxx>
>> > To: robert@xxxxxxxxxx
>> > Cc: php-general@xxxxxxxxxxxxx
>> > Sent: Thu, Mar 10, 2011 11:38 am
>> > Subject: Re:  Issue with Quick Email validation
>> >
>> >
>> > try != instead of ==, that should do the trick.
>> >
>> >
>> >
>> > 2011/3/10  <robert@xxxxxxxxxx>:
>> >
>> >> 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@xxxxxxxxxxx
>> >
>> >>
>> >
>> >> 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
>>
>>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux