Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to email IP and browser type on page load?

Status
Not open for further replies.

haxan

Technical User
Oct 8, 2005
16
NL
Hi all i am kind of new to php. I wonder how i can email user ip address and browser type on page load. What i mean is once a page loaded on visitor browser it sends me the administrator of a site an email with ip address of visitor and browser type . I be happy if an expert help me achiving this task.Thanks
 
Search on google (and read the current messages in this forum) on sending emails from php.

Some links:
thread434-1148758
faq434-2681
faq434-1203

Once you've figured that out, then you just need to do some light searching to find out how to handle the browser agent ($_SERVER['HTTP_USER_AGENT']) and remote ip address ($_SERVER['REMOTE_ADDR']).

once a page loaded on visitor browser it sends me the administrator of a site an email
Remember that PHP is a server-side language and once you have delivered the HTML to the page, there is no way you can interact with the page... and so there is no way you can know when the page has "loaded" (in the browser).

I suggest you send the emails just before you deliver the page to the user instead.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]

What is Javascript? faq216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top