This message was edited by Manning at 2004-5-14 17:6:15
: I have a question. I want to make a script that displays how many clicks a link has gotten. Now, I know how to do this with just PHP. The problem with that is that the file has to be present already to display a number. I mean, it takes time. You have to do alot of extra coding and input to make it work. I was wondering if anyone has a more dynamic way of doing this, with say, MySQL. I want it so that I don't have to code anything extra for a link that I add. So I can just add a link and add a certian iD to it so its automacticly added. I don't want to have to add code and etc with the link. Ya feel me?
Have it go through a redirect page. So instead of linking to
http://www.google.com directly, link to
http://www.yoursite.com/link.php?url=www.google.com. Now your link.php script can insert a record into your MySQL database, and then use header("Location: " . $_GET['url']); to redirect to the destination page
(you should have http:// in there too for maximum compatability...but IE screwed up the display if I included that on the example link)