Results 1 to 4 of 4
  1. #1
    Full Member dak142's Avatar
    Join Date
    January 18th, 2005
    Posts
    386
    I am putting a form on my website to collect email address for a newsletter. Is there a way of validating that the email address is at least in the general form of an address.

    Like Someone@someplace.com, I have been trying to do it in PHP but what I have seems to let ANYTHING go through to the database. Any ideas on what I can do?

  2. #2
    Full Member
    Join Date
    January 18th, 2005
    Location
    UK
    Posts
    273
    You probably need to get your mind round regular expressions.
    They are tricky the first time, and my brain hurts every time I use them, but they are worth the effort.

    For a thread on using them with PHP and email addresses see
    http://siteownersforums.com/showthread/t-717.html

    Better still also check it with Javascript using onSubmit event

    See
    http://www.webreference.com/js/tips/990928.html
    for example of using regular expression to validate email addresses in Javascript

    Hope that helps

    Les

  3. #3
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    Honiara, Solomon Islands
    Posts
    1,085
    <pre class="ip-ubbcode-code-pre">if((!ereg(".+\@.+\..+",$Email)) || (!ereg("^[a-zA-Z0-9_@.-]+$",$Email))){$error.="Your error message here.";} </pre>

    $email= the variable you have stipulated and the Name of your email input box.

    Let me know if you need more help and I'll write it for you.

  4. #4
    ABW Adviser Panel Dynamoo's Avatar
    Join Date
    January 18th, 2005
    Location
    Opposite the Slough of Despond
    Posts
    5,465
    I use Topica - http://lists.topica.com/ - which handles everything for me, for free. It sometimes bundles some fairly irrelevant advertising links, but I've been happy with it.
    Innovative advertising with Slimeware Corporation and Telephore. Mail-order fuel with Petrol Direct.

  5. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. New to ShareASale - Waiting for validation email
    By w3expose in forum ShareASale - SAS
    Replies: 6
    Last Post: February 15th, 2011, 03:51 PM
  2. AM sends email out to Affiliate list with our email Address Showing
    By glittered in forum Commission Junction - CJ
    Replies: 27
    Last Post: January 27th, 2007, 12:06 AM
  3. Validation error on change of address
    By La_Valette in forum Rakuten LinkShare - LS
    Replies: 2
    Last Post: December 29th, 2006, 11:44 AM
  4. Email Validation
    By popdawg in forum Rakuten LinkShare - LS
    Replies: 2
    Last Post: December 8th, 2006, 12:35 PM
  5. Email address ina SQL database... How to send out mass email?
    By jackson_media in forum Programming / Datafeeds / Tools
    Replies: 4
    Last Post: February 12th, 2006, 04:54 PM

Posting Permissions

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