Newbie trying to write a e-mail subscription script

Discussion in 'PHP' started by deepman007, Mar 6, 2008.

  1. #1
    HI

    I want to create an E-mail subscription script in PHP and the problem is I'm just a beginner in PHP. I know the basic structure of the E-mail Subscription.

    1. Need an input form, takes in the E-mail address

    2. checks the input e-mail addres
    a) if its correct, store to database
    b) if its not correct, display a message saying wrong e-mail address.

    3. In the admin page, need to send a message to all the subscribers.

    For the first part, I did with html:
    <form method=post action=check_store.php><input type=text name=email size=20 ><input type=submit value='Subscribe'></form>

    1st question is my basic understanding correct?

    2nd, how do I approach to write this check and store email ?

    Thank you
     
    deepman007, Mar 6, 2008 IP
  2. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #2
    Check what about the email address? Check if its present in the DB already? Check if its a valid email address? If the latter the best test is to send an email to that address and wait for a verify response via a URL. You would need to show the structure for the DB you are using.
     
    shallowink, Mar 7, 2008 IP
  3. deepman007

    deepman007 Peon

    Messages:
    99
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Looks like its hard to write a script like that ? the database I'm using is from the 3rd party shopping cart and there's a table about customers. Is it a good idea to insert E-maill address in t here or create another table ?
     
    deepman007, Mar 7, 2008 IP
  4. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #4
    Odds are there is a field in the table already setup for customers email. Might be best to create your own table.
     
    shallowink, Mar 7, 2008 IP
  5. sweetragini

    sweetragini Banned

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I can help you regarding this
     
    sweetragini, Mar 7, 2008 IP
  6. deepman007

    deepman007 Peon

    Messages:
    99
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Yea, inside the customer table there is a field called customer E-mail. So Its best that I just create another table inside that shopping cart database right just for subscription?
    1. user types in an e-maill address, how do I check if its right in php?
    take the string apart, look for @, .,com ?
     
    deepman007, Mar 7, 2008 IP