I am working on a site to allow users to download a file. I am looking for a script that lets me identify the referrals who are sending visitors to my site by their identifiers download.php?id=555. i want to identify the nbr of downloads of each partner. Thanks a lot
Asked
Active
Viewed 2,566 times
0
-
Show us what you've tried. – Jonathan M Dec 31 '12 at 22:28
-
You could try using Google Analytics if you only need to track referrers. Otherwise, if you need something like Amazon, then try to code it yourself and post it on github for the rest of us! – hafichuk Dec 31 '12 at 22:29
-
actually i did nothing concerning the php part of the website. – Nizar Barkallah Dec 31 '12 at 22:35
1 Answers
1
Simply you have to include a php script file in every page of your website. This script will look for a url parameter, let we say, referalId by $_GET['referalId'] if it is found and It has a valid value, you have to do some action in your databse.
if (isset($_GET['referalId'] && isValid($_GET['referalId')){
//doSomeThing In The DB.
}
Notice isValid should be custom defined function to validate the value of the $_GET[referalId'] value to prevent sql-injection and other unsuitable values

SaidbakR
- 13,303
- 20
- 101
- 195