Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Re: Conditions for a valid email address

  1. #1
    Join Date
    Jul 2005
    Posts
    23

    Default Re: Conditions for a valid email address

    Im currently using the following for email checks.

    <input type="hidden" name="conditions" value=":##TEST#EmailAddr=EmailAddr0#The two email addresses you provided do not match.#" />

    That compares the email field with the email verify field but.......

    I also need to use the following to make sure the email addresses of both fields are at least valid.

    <input type="hidden" name="conditions" value=":##TEST#email ~ /^[a-z0-9_.]+@[a-z0-9_]+\.([a-z0-9_.]+)*[a-z0-9_.]$/i # Please enter a valid email address.#" />

    Is it possible to use two condition tags? I'v tried concatinating them but either one works and the other doesnt. Is there a way to do this?

    Thanks.

  2. #2
    Join Date
    Jul 2005
    Posts
    175

    Default Re: Conditions for a valid email address

    hi

    yep, it is

    by the way, i recommend to derive "email"
    Code:
    <input type="hidden" name="derive_fields" value="email=emal" />
    you haven't to do that, but if you do and/or using fmbadhandler, the email-field would not be cleared anymore after returning to your form if there had been occuring an error before


    then name the 2 email fields e.g. "emal" and "emal2"
    the corresponding conditions looks like
    Code:
    <input type="hidden" name="conditions1" value=":##TEST#emal ~ /^[a-z0-9_.]+@[a-z0-9_]+\.([a-z0-9_.]+)*[a-z0-9_.]$/i #Please enter a valid email address.#:
     #TEST#emal=emal2#The two email addresses you provided do not match.#" />
    or "email" and e.g. "email2" if not derived..

    that's it

    erik

  3. #3
    Join Date
    Jul 2008
    Posts
    9

    Default Re: Conditions for a valid email address

    Can I possibly use information boxes like in javascript for example? When the page re-loads in displays some error messages and stuff surfers normally do not read it, I did not read it myself at first as well, only later I noticed there was some info at the bottom line saying something like "please, enter correct e-mail address"... Information boxes that look like a separate pop up window are a way more effective. Does anybody happen to know if there is a way to integrate javascript and php? I've been experimenting for some time but cannot seem to figure it out so far... Not much use though (either against spammers, form validation (conditions) or anything) but would be a whole lot more effective!

  4. #4
    Join Date
    Oct 2008
    Posts
    3

    Question Re: Conditions for a valid email address

    In relation to this post I have this problem with hyphenated email domain names.

    Code:
    <input type="hidden" name="conditions1" value=":##IF#yourName#yourName !~ /enter_your_name/#!#Please provide your name.#:#TEST#emailAdd ~ /^[a-z0-9_.]+@[a-z0-9_]+\.([a-z0-9_.]+)*[a-z0-9_.]$/i #Please enter a valid email address.#:#TEST#emailAdd=confEmail#The email addresses submitted do not match.#:#TEST#add_1#please enter the first line of your address.#:#TEST#postCode#please enter your postcode.#:#TEST#telMob#You must enter a contact number.#" />
    So above are some conditions which kick along nicely until some person tries to submit and confirm an email address with a hyphen. For example another@stoned-loser.com will be rejected sending the usual error message with the test that failed, where as conversely an email address such as nice@tidydomain.net wings its way speedily through.

    Anyhoo, some pointer, a ray of light would be vastly appreciated;

    confusedly yours.


    Psypha

  5. #5
    Join Date
    Jul 2008
    Posts
    9

    Default Re: Conditions for a valid email address

    Beat this php stuff, Psypha. Go for javascript. The best codes for fields' validation I've seen so far are writtien in javascript. I re-programmed mine to validate fields in js then passed it on back to php formmail. Don't you believe it that it is impossible to combine / incorporate php into js and vise versa! It is not true! I managed it! It works just perfectly and it is a whole lot more effective when you get a new window popping up saying for example, "enter a vaild e-mail address" or "your name is mandatory". Implement any javascripts' fields validation code into your form mail once and you will forget about it forever as it will stay guard 24 clocks around without any problems! There are literally millions of those readily available out there on line for free. It is really very simple. Good luck!

  6. #6
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Conditions for a valid email address

    Implement any javascripts' fields validation code into your form mail once and you will forget about it forever as it will stay guard 24 clocks around without any problems!
    i think this is misleading....

    JavaScript is fine for user-friendliness - the user gets immediate feedback, but it does nothing to protect ur data because users can have js switched off and bots dont use it

    always validate via PHP and use JS to make things more friendly - dont rely on JavaScript to validate form data.

    u have:
    Code:
    <input type="hidden" name="conditions1" value=":#
    #IF#yourName#yourName !~ /enter_your_name/#!#Please provide your name.#:
    #TEST#emailAdd ~ /^[a-z0-9_.]+@[a-z0-9_]+\.([a-z0-9_.]+)*[a-z0-9_.]$/i #Please enter a valid email address.#:
    #TEST#emailAdd=confEmail#The email addresses submitted do not match.#:
    #TEST#add_1#please enter the first line of your address.#:
    #TEST#postCode#please enter your postcode.#:
    #TEST#telMob#You must enter a contact number.#" />
    to allow hyphens:
    Code:
    <input type="hidden" name="conditions1" value=":#
    #IF#yourName#yourName !~ /enter_your_name/#!#Please provide your name.#:
    #TEST#emailAdd ~ /^[-a-z0-9_.]+@[-a-z0-9_]+\.([-a-z0-9_.]+)*[a-z0-9_.]$/i #Please enter a valid email address.#:
    #TEST#emailAdd=confEmail#The email addresses submitted do not match.#:
    #TEST#add_1#please enter the first line of your address.#:
    #TEST#postCode#please enter your postcode.#:
    #TEST#telMob#You must enter a contact number.#" />
    i.e. just add a - after the [ in 3 places.

    and u can use newlines to make the whole thing more readable, as above

  7. #7
    Join Date
    Jul 2008
    Posts
    9

    Default Re: Conditions for a valid email address

    It depends on what you are doing crabtree. Partially I agree with you but the most web-sites are no banks so they do not need that much protection of the data and all. You can have js switched off, turn off headers, disconnect graphics, disable pop ups, turn on your privacy to the highest level possible, you name it, etc... But in this case you will not enjoy all the features there are out there so I suggest you might as well keep your computer turned off too then which will ensure MAXIMUM PROTECTION of absolutely EVERYTHING...

  8. #8
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Conditions for a valid email address

    It depends on what you are doing crabtree
    sure...everything depends on ur business model (i.e. what u want)

    as a website owner, if it doesnt matter that junk gets into ur database or just into ur inbox then js validation is fine...

    i even have some websites like that - it just doesn't matter (and i dont do any validation)

    similarly, if ur happy to make ur website unusable by a percentage (probably small %) of people, then u can make ur whole website in js

    same argument for flash websites

    i just dont see the point of validating something if the validation isnt going to work for bots or can be bypassed by some users

    in the OP's case, they may as well not validate the email address at all if they going to rely on js to do.

    the only true validation is that done when the website owner has control - that is, validation done on their webserver

    js-only validation basically protects u from legitimate and careful users, and lets all other junk in. So, wots the point?

  9. #9
    Join Date
    Jul 2008
    Posts
    9

    Default Re: Conditions for a valid email address

    Almost any code can be hacked and bypassed.. so what's your point then? My js validation works as I programmed it together in combination with php... I have absolutely no junk getting in... well, wahtever, I do not have to prove anything to you. You do it the way you like and I will do it my way. Plus, validation you suggest does not have webserver / website owner control ither. Anyway good luck on that and bye!

  10. #10
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Conditions for a valid email address

    Quote Originally Posted by Den7 View Post
    Almost any code can be hacked and bypassed..
    no, not true.

    code that's on the server cannot be bypassed.

    so what's your point then?
    that's my point. js can always be bypassed and is probably always bypassed by bots

    My js validation works as I programmed it together in combination with php... I have absolutely no junk getting in...
    then it must be 'coz of ur instructions to formmail...its not 'coz of ur js.

    and, bots are getting smarter. some bots now know to skip required and conditions statements

    if they find ur site, youll start getting junk thru.

    u can then solve that by moving ur requried and conditions fields into an INI file (see below).

    well, wahtever, I do not have to prove anything to you.
    no, but i'm trying help u understand - it's not a fight or an argument.

    most importanly, i'm trying to help the OP, 'coz i think ur original comment was misleading

    Plus, validation you suggest does not have webserver / website owner control ither.
    yes, it does (or can do).

    if the instructions to formmail are in the HTML, then they can be bypassed, but only my a bot that knows to leave those fields (conditions, required) out.

    if they are moved to an INI file, then they cannot be bypassed by any user or any bot.

    so, the website owner has control of their validations

    this is not possible with js

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Don't want to force entering an email address
    By Goji in forum FormMail Subscription Support
    Replies: 10
    Last Post: 22-Jun-2004, 01:54 AM
  2. no valid recipients were specified.
    By SonSon in forum FormMail Subscription Support
    Replies: 3
    Last Post: 08-Apr-2004, 07:27 AM
  3. yet another no valid receipient
    By koocha in forum FormMail Subscription Support
    Replies: 6
    Last Post: 11-Feb-2004, 10:04 PM
  4. No valid recipients
    By Oktopuz in forum FormMail Subscription Support
    Replies: 2
    Last Post: 06-Feb-2004, 05:48 AM
  5. detect valid email sender
    By richardsb24 in forum FormMail Subscription Support
    Replies: 1
    Last Post: 01-Feb-2004, 04:16 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •