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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the domain name of the user visiting a web page?

Status
Not open for further replies.

Sina

Technical User
Jan 2, 2001
309
CA
hello everyone,

How can I get the domain name of a user who is visiting my php page on the net?

I know about the apache logs and all, but wanted to know if there is a function in php that can get the domain name of a visitor.Thanks much
 
users dont have domain names (domain name =
what you can get from the user is

$REMOTE_ADDR = the ip number of the machine, of limited usefulness as most people still use dial-up with a generated IP from the ISP Ip listing

$HTTP_REFERRER = the domain that referred the user to your site/page. Can be used as a form of security by limiting the page views to pages from you domain only...it people must login in first and can only see your pages from after login, when used with other authentication method.

there are others as well, check
hth
Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top