Counter Info - Emailing

This is a discussion on "Counter Info - Emailing" within the PHP Forum section. This forum, and the thread "Counter Info - Emailing are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Dec 4th, 2006, 17:54
New Member
Join Date: Dec 2006
Location: New Orleans
Age: 25
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Counter Info - Emailing

Hello,

My knowledge is very limited of PHP, but I do have a basic understanding. I am trying to set up a counter while gaining some info about the visitor (referrer, browser, ip, country, etc.). Now this can either go to a designated txt file or can be e-mailed directly to me. If it does go to a txt file, is there a way to set up a command to have the content within the txt file, e-mailed to me? Any help would be greatly appreciated. Thanks.

Brandon
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Dec 4th, 2006, 21:51
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Counter Info - Emailing

Yeah sure, you could just do both. I have to say, though, having user text uploaded to a file is something to avoid if possible, unless you are really an expert at security.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Dec 4th, 2006, 22:05
New Member
Join Date: Dec 2006
Location: New Orleans
Age: 25
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Counter Info - Emailing

Thanks Mason for getting back with me. I was not talking about a user uploading file but instead a website hit counter. So that I can track how many visitors I have coming to my website. I want to gather the information that a visitor's computer give such as ip, referrer, browser, country and etc. and have them sent to me via e-mail. And I am at a loss on how to set the coding to accomplish that particular task. Any help would be great, thanks.

Brandon
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Dec 5th, 2006, 16:33
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Counter Info - Emailing

I've never done this and I'm no email expert -- that said, my initial approach would be:

First, use a sniffer to set variables representing the various bits of information, such as
Code: Select all
$browser= $_SERVER['HTTP_USER_AGENT'];
Then use the php mail() function and echo the variables inside the message. My first thought would be to do a series of "if" statements with concats, like
Code: Select all
$message_txt = 'Counter information for www.mysite.com: /n/n';

if ($browser) {
$message_txt .= "Browser: $browser /n";
} else {
$message_txt .= "No browser detected /n";
}
Newline characters can be tricky in mail programs so check your php.ini and read some documentation.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Dec 9th, 2006, 22:33
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Counter Info - Emailing

Google Analytics is already made
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
coding, counter

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Emailing a php page with url request parameter GrayZone PHP Forum 1 Sep 19th, 2007 15:46
Counter confused Website Planning 6 May 21st, 2007 03:27
hit counter? skyfire400 Web Page Design 6 Mar 7th, 2006 15:00
emailing webpage, or corporate newsletter wood1e Web Page Design 3 Jun 30th, 2005 08:44
print "$counter times 2 is ".($counter*2)."<br>" gwx03 PHP Forum 6 Dec 10th, 2003 11:50


All times are GMT. The time now is 10:40.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved