Go Back   WarriorForum - Internet Marketing Forums > The Warrior Forum > Main Internet Marketing Discussion Forum
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 09-03-2009, 02:45 AM   #1
Lisa Dozois
War Room Member
 
lisag's Avatar
 
Join Date: Jan 2006
Location: Florida, USA.
Posts: 612
Thanks: 85
Thanked 221 Times in 110 Posts
Social Networking View Member's Twitter Profile 
Default Quick and Dirty Hit Notifier

From time to time I like to get instant notification when my site is visited. I do this especially on landing pages when I first start promoting them. I do it all the time on my freelance portfolio site so I can see when people are checking me out.

It's not an elegant solution but it works for me. It might be something you would want to use, so here it is. It's in PHP. Just install it at the top of your index.php, after any include file statements, or add it to your config.php.

// send the admin an email
// Remember to change the values for $sitename and $admin_email!
$ttime = date("F j, Y, g:i a");
$sitename = 'Your site name goes here';
$admin_email = 'youremail@address.com';
$ip = getip();
$host = gethostbyaddr($ip); //Native PHP function
$origin = $_SERVER['HTTP_REFERER'];
if (empty($origin)){$origin = 'an unknown link ';}
$message = "A visitor from $host ($ip) visited via $origin at $ttime.";
$subject = "New visitor to $sitename";
mail($admin_email,$subject,$message);
function getip() {
if (isSet($_SERVER)) {
if (isSet($_SERVER["HTTP_X_FORWARDED_FOR"])) {
$realip = $_SERVER["HTTP_X_FORWARDED_FOR"];
} elseif (isSet($_SERVER["HTTP_CLIENT_IP"])) {
$realip = $_SERVER["HTTP_CLIENT_IP"];
} else {
$realip = $_SERVER["REMOTE_ADDR"];
}
} else {
if ( getenv( 'HTTP_X_FORWARDED_FOR' ) ) {
$realip = getenv( 'HTTP_X_FORWARDED_FOR' );
} elseif ( getenv( 'HTTP_CLIENT_IP' ) ) {
$realip = getenv( 'HTTP_CLIENT_IP' );
} else {
$realip = getenv( 'REMOTE_ADDR' );
}
}
return $realip;
}

-- Lisa G
lisag is offline   Reply With Quote
Old 09-03-2009, 03:25 AM   #2
Active Warrior
 
GraphicsGurl's Avatar
 
Join Date: Aug 2009
Posts: 31
Thanks: 19
Thanked 3 Times in 3 Posts
Contact Info
Send a message via Skype™ to GraphicsGurl
Default Re: Quick and Dirty Hit Notifier

Thanks for sharing! I'm going to use this on a couple of my sites..

How to Set Up a Website Using WordPress Step-by-step! ->PLR rights included!<- WordPress PLR eBook

Your Article Service: Article Writing, Spinning, Submission and Article to Video Creation Services.
GraphicsGurl is offline   Reply With Quote
Old 09-03-2009, 03:29 AM   #3
Webweaver
 
devilishsaint's Avatar
 
Join Date: Aug 2009
Posts: 119
Thanks: 4
Thanked 2 Times in 2 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile 
Default Re: Quick and Dirty Hit Notifier

Its working well for me thanks for sharing good work

devilishsaint is offline   Reply With Quote
Old 09-03-2009, 03:32 AM   #4
A Writer, Naturally
War Room Member
 
Andrew G Gowans's Avatar
 
Join Date: Jan 2007
Location: The Scotsman in Spain.
Posts: 240
Thanks: 12
Thanked 22 Times in 20 Posts
Social Networking View Member's Twitter Profile 
Contact Info
Send a message via Skype™ to Andrew G Gowans
Default Re: Quick and Dirty Hit Notifier

Thank you Lisa G,

I have a few totally new sites to which I can apply this and monitor the activity.

Regards
Andrew G.

Andrew G Gowans is offline   Reply With Quote
Old 09-03-2009, 04:05 AM   #5
HyperActive Warrior
 
FifthDimension5's Avatar
 
Join Date: Jul 2009
Posts: 186
Thanks: 4
Thanked 24 Times in 20 Posts
Social Networking View Member's Twitter Profile 
Default Re: Quick and Dirty Hit Notifier

This is great, the script mails you when a visitor lands on your page.

You can get even more stats (real time web stats) by using
whos.amung.us/

(free instantly see where your visitors are from)

For more advanced real time tracking including mouse movements of visitors there is this site: clixpy.com

FifthDimension5 is offline   Reply With Quote
Old 09-03-2009, 05:10 AM   #6
Lisa Dozois
War Room Member
 
lisag's Avatar
 
Join Date: Jan 2006
Location: Florida, USA.
Posts: 612
Thanks: 85
Thanked 221 Times in 110 Posts
Social Networking View Member's Twitter Profile 
Default Re: Quick and Dirty Hit Notifier

I updated the code to replace the missing statement that adds the date and time of the visit to the email.

So if you are running the script and your notification email message ends with "at" and no date and time, just recopy the code at the top of this thread and reinstall.

-- Lisa G
lisag is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > The Warrior Forum > Main Internet Marketing Discussion Forum

Tags
dirty, hit, notifier, quick

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 01:10 AM.