How do I only allow visitors from specific domains?
<p>I have a PHP based website that uses coupon codes. I can restrict search engines from finding the landing page of a coupon code (like if it was an ad on another page). </p>

<p>But I also want to restrict the coupon code so that it only works if they came from the site serving the coupon code. That way, if someone find the code, they can't just post it on a blog. Granted, it's good business to have a Coupon code go viral, but we need it to be restricted for marketing analysis.</p>

<p>So if I put an ad on www.examplead.com, and someone comes to our website from clicking the ad, I want to allow the coupon code to work. If they come from www.exampleblog.com, or any other site other than www.examplead.com, I don't want to allow the coupon code to work.</p>

<p>I don't need help with writing code that will disable/enable coupon codes, but I need help with filtering where someone is coming from, and then executing a function based on that.</p>

<p>If someone else has a better method for keeping track of coupon codes, please let me know.</p>
