SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot Wynnefield's Avatar
    Join Date
    Sep 2005
    Location
    North Texas
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Received email link to pre-fill HTML form from database

    We are setting up an email campaign, and would like to make it as easy as possible for those who opt-in to submit the form. If the email link has the originating email address appended to the URI, can I use PHP to connect to our database, search a table for the email address, and if found, pre-fill the HTML (PHP) form, so the customer only has to confirm/correct the information we already have, rather than enter it all.

    Those who opt-in and select the link are requesting a complimentary item be mailed to them, so we will need to confirm their mailing address. When the form is submitted, it will need to write the information back to the database.

    Is this a complex process? I believe the database is MySQL and I understand PHP and MySQL plan nice together, so how complicated a coding job is this project?

    Thank you in advance for your time and consideration.

  2. #2
    SitePoint Addict kduv's Avatar
    Join Date
    May 2012
    Location
    Atlanta, GA
    Posts
    244
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    It wouldn't be very difficult. Just add the user's email address to the querystring. ie: yoursite.com/promotion.php?email=joe@blow.com

    A note on security: I would also include a unique key in the querystring: promotion.php?email=joe@blow.com&key=6a5sf6f87e5465dasf. Then compare that key to the one you have stored for the email address in your DB.

    Otherwise, someone can go to promotion.php and try random email addresses (or known email addresses) and set any of your user's mailing details.

  3. #3
    SitePoint Zealot Wynnefield's Avatar
    Join Date
    Sep 2005
    Location
    North Texas
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you Keith. I appreciate the additional security suggestion.

    Now to learn how to write the PHP ... ;-)


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
  •