Internet Marketing Blog

The Internet Marketing blog of Mike Merz, Internet Marketing consultant, in regards to what's hot ... and what's not, in the world of Internet Marketing.

Sunday, April 11, 2004

 

Simple PHP redirect - hit notification script

My good friend Adrian Ling (easybiztools.com) offered up a neat little PHP redirect, that sends you an email notification each time it's clicked.

It also provides the referred site ... as long as your site host has that function enabled.

Either way, it's an easy way to redirect an affiliate URL (or one you'd like to shorten), and the email notification is extra handy if you're tracking hits from from an ad run, split test, or download.

Cut and paste the following code into a blank page, and save it as 'whatever.php'

-------- start ------------


/* =========== start editing ========= */
$domain = "yourdomain.com";
$emailto = "name@yourdomain.com";
$subject = "Ebook Download Hit Report";
$url = "http://www.theurlyouwanttorediertto.com/";
/* ========= end of edit =========== */



$ref = getenv("HTTP_REFERER");
$today = date("d-M-Y [H:i:s]");
$req = getenv("REQUEST_URI");
$req_url = "http://www." . $domain . $req;


$mesg= "Date: $today:\nURL hit: $req_url\nReferred by: $ref\n";
mail("$emailto","$subject","$mesg","From: webmaster@$domain");
header("Location:$url");exit();
?>


-------------- end ------------------

Edit only the following lines in the script above ...

"yourdomain.com" - domain name of the site it's being uploaded to (without the 'http://').
"name@yourdomain.com" - the email address you want the click report sent to.
"Ebook Download Hit Report" - the subject name of the hit report.
"http://www.theurlyouwanttorediertto.com/" - the URL you want to redirect to.

Enjoy!

Mike

PS

Adrian is the man behind easyClickMate, the ultimate ClickBank Affiliate Program management software.

I've arranged for Adrian to give you a special discount, which can only be accessed via this link.
(easyClickMate 4.0 was just recently released ... and it's easily the best version yet).

Comments: Post a Comment





<< Home

Archives

January 2004   February 2004   March 2004   April 2004   May 2004   June 2004   July 2004   August 2004   September 2004   October 2004   November 2004   December 2004   January 2005   February 2005   March 2005   April 2005   May 2005   June 2005   July 2005   August 2005   September 2005   October 2005   November 2005   December 2005   January 2006   February 2006   March 2006   April 2006   May 2006   June 2006   July 2006   August 2006   September 2006   October 2006   November 2006   December 2006   January 2007   February 2007   April 2007   May 2007   June 2007   August 2007   September 2007   October 2007   January 2008   May 2008   September 2008   October 2008   November 2008   December 2008   January 2009   February 2009   March 2009   April 2009  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]

Copyright 2009 Internet Marketing For Newbies - JV Notify Pro Joint Ventures - JV List Pro Autoresponders