Entry
How difficult would it be to use PHP/SQL to count when people click on an email or web link?
Feb 18th, 2003 02:39
Louis Brown, Michael Erb,
Have a table with fields: "link", "count".
Have a page that you point all of your links/emails to.
e.g.
For a "Web Link":
www.mysite.com/tracker.php?link=www.bbc.co.uk
For a "email":
www.mysite.com/tracker.php?link=mailto:you@yourdomain.com
in "tracker.php":
Do a SELECT to see if an entry for "link" already exists, if it does
UPDATE the count by 1, if it doesn't INSERT a new record.
then redirect the browser to the "link".
header("Location: $link");
For email the browser will spawn an email dialogue from this, but its
up to you where you actually want to send the browser to.