Landing URL auto writes to database (how?)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wellscrambled
    New Member
    • Jan 2008
    • 3

    Landing URL auto writes to database (how?)

    Not quite sure where to start with this one; can anyone point me in the right direction?

    I send emails to my customers which contain various links. When the customer clicks the link embedded within the email, I want the page they land at to automatically write that users email address (from the email they received) with the date and time stamp of their click directly to a data gathering table in the database.

    Now, I am not familiar with PHP but can use HTML and javascript. Any assistance gratefully accepted.

    Nick
    Virtual Server
    PHP 5.1.2
    MySQL server 5.0.18
    Web Server: Apache/2.2.3 (Linux/SUSE)
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi.

    This can be achieved in various ways by using PHP and MySQL.

    The first thing that comes to mind would be:
    • When sending an email, log it in your database along with a unique number (perhaps the using the microtime() function).
    • Append that unique number to the links, so that they can be read via the $_GET array. For example: www.example.com/page.php?id=123456
    • When the link is clicked, have your PHP code match the number to your database log and retrieve the email.
    • Add the hit to your database.

    Comment

    • dlite922
      Recognized Expert Top Contributor
      • Dec 2007
      • 1586

      #3
      Originally posted by wellscrambled
      ...I am not familiar with PHP but can use HTML and javascript...
      You definetly need to know PHP and how to use PHP with MySQL perhaps we can direct you to some sites

      Here's one we love: http://w3schools.com/php/default.asp

      Comment

      • TheServant
        Recognized Expert Top Contributor
        • Feb 2008
        • 1168

        #4
        Originally posted by dlite922
        You definetly need to know PHP and how to use PHP with MySQL perhaps we can direct you to some sites

        Here's one we love: http://w3schools.com/php/default.asp
        For a very basic one, I used tizag which started me off on my PHP road!

        Comment

        Working...