Page 1 of 1

logging referring ip address

Posted: Wed Oct 20, 2004 9:16 am
by kendall
Hello,

i am current developing an ad system that logs the ip address of the web page that shows the banner. i was using the $_SERVER['HTTP_REFERER'] but read that this is an unsure thing. Is there anything else that could give me a more accurate info. im using php 4.2


kendall

Posted: Wed Oct 20, 2004 9:21 am
by feyd
require them to send an id that tells you what site it is?

Posted: Wed Oct 20, 2004 9:32 am
by kendall
feyd,

I dont understand what you ment there. what is the $_SERVER['REMOTE_HOST'] ?

Kendall

Posted: Wed Oct 20, 2004 9:36 am
by feyd
$_SERVER wrote:'REMOTE_HOST'

The Host name from which the user is viewing the current page. The reverse dns lookup is based off the REMOTE_ADDR of the user.

Note: Your web server must be configured to create this variable. For example in Apache you'll need HostnameLookups On inside httpd.conf for it to exist. See also gethostbyaddr().

Posted: Wed Oct 20, 2004 9:41 am
by kettle_drum
What feyd suggested in his first reply was to have the banner link include the url or id of the site - so you reply on the link itself rather than the user.

Posted: Wed Oct 20, 2004 10:00 am
by kendall
feyd,

lol....of course i know that!!!...but i wanted to no what it meant.

kettle_drum....ooooohhhhhhhh i see

kendall

Posted: Wed Oct 20, 2004 10:32 am
by feyd
it means exactly what the description says: it's the DNS name of the remote address accessing the page.

Posted: Wed Oct 20, 2004 11:04 am
by kendall
feyd,

sorry for my ignorance. i was wondering "whose" remote address was it the user or the web page. im using a method that allows the banner script to be accessed via a

Code: Select all

<script src="url to script"></script>
while i am implimenting the suggestion i want a more simple method. Isnt there a more dynamic way of getting the page that a banner shows up on?

Kendall

Posted: Wed Oct 20, 2004 11:09 am
by feyd
without some help from the requesting page, not really. You can use Javascript to pass the url to your scripts by making the image come from a image dropping script.

window.location.href is the full url Javascript would see. Granted, this requires that the client has Javascript turned on.