Hello, Can someone help me create a script so that people can put my link on their site and when others click on it and signup for my services it records who it was from? It is for a site like tcmhosting.net
Well, here is a (very) simple way for people who have cookies enabled. Just put the following code at the top of every page of your site (assuming your site is written in php), and when someone purchases a product from you, just pull the data from $_COOKIE['ref']. <php $ref = $_GET['ref']; $domain = $_SERVER['SERVER_NAME']; if ($ref) { setcookie('ref', $ref, time()+5184000, '/', $domain, 0); } ?> Code (markup): Then have everyone who links to your site simply link to it like this: digitalpoint.com?ref=myrefid and their affiliate id will be placed in a cookie and will be credited to them (assuming that the visitor has cookies enabled) if the person they refered buys a product within 60 days. A few things on this script: 1. It only works for people who have cookies enabled. 2. It would be best to do a 301 redirect from the link with the affiliate id to the page without the id on the url for search engine purposes. 3. There is a slight possibility that your server doesn't have $_SERVER['SERVER_NAME'] enabled, which would mess up this script. 4. You will obviously need to figure out a way to associate affiliate id's with people so you get the right paychecks to the right people. 5. You might consider changing "?ref=asdf" to something else which would not identify it as an affiliate link. Hope this helps...
Where would I put this code? Also if I gave someone named test a referral link would I just give him a link like tcmhosting.net?ref=test ? I'm wondering how to actually set this up.
Sounds like you could do with gettng a freelancer to do this for you. It's too complicated to knock it out as a script suggestion here in a forum post considering it will involve a database etc. I'd recommend get-a-freelancer.com .
create a unique url for each referrer like: referrer.php?name=UNIQUE let the visitor fill out the form you want, add a hidden input field with the referrer's name <input type="hidden" name="referrer" value="<? echo $_REQUEST['name']; ?>">
Just buy a low cost affiliate tracking script and save yourself some headaches. Some are around $99 and I have seen cheaper. -Peter