how get domain name?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
kreoton
Forum Commoner
Posts: 42
Joined: Fri Mar 03, 2006 7:27 pm

how get domain name?

Post by kreoton »

hi, i have one silly question how get domain name of site were is plased my sites banner. Banner is generated by php and users includes its like this:

Code: Select all

<img src="http://mysite.com/image.php" />
in image.php i whant to log how many visits has sites with my banner, i tried to use $_SERVER['HTTP_REFERER'] but with no luck
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

If that information is not voluntarily sent by the browser making the request, you have no easy way of finding out. This is why most many image links are given out with a uniquely identifiable mark.
Post Reply