giraffemedia Posted November 2, 2007 Share Posted November 2, 2007 Hello this is my first post and i'm a newbie so please bear with me. I'm putting an advert onto my company website and the client has requested to know the amount of traffic the advert attracts (a click through). How can I incorporate php to log all click throughs to a file on the server for the client? Can I use something like this? http://www.dynamicdrive.com/forums/archive/index.php/t-5341.html Thanks in advance. James Quote Link to comment https://forums.phpfreaks.com/topic/75797-log-url-link-throughs-to-file/ Share on other sites More sharing options...
Dragen Posted November 2, 2007 Share Posted November 2, 2007 yes a similar kind of thing. You basically need to store the data in a database. Have the url in the advert as something like: http://www.mydomain.com/ads.php?id=123 where the id is the id stored in the database corresponding to the advert. Then on ads.php you need to read the $_GET['id'] info. check that it exists in the database. If so forward onto the advertised site. BEFORE your forward them, you need to check the referrer ($_SERVER['HTTP_REFERER']), i'd suggest ip (to track unique hits) and a timestamp. Then store this in the database. Quote Link to comment https://forums.phpfreaks.com/topic/75797-log-url-link-throughs-to-file/#findComment-383617 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.