Forum Moderators: DixonJones

Message Too Old, No Replies

Desination URL Question

How to get referrer IP address into destination url

         

facher

12:01 am on Oct 9, 2006 (gmt 0)

10+ Year Member



When I clicked on an ad in YSM today, I noticed the URL on the desination page had my IP address listed in it...How would one go about setting something like that up? Code is listed below. Thanks.

http://www.example.com/microsites/example%20name/default.asp?MB_ID=2623&SE_ID=1&MSC_RefIP=64.88.XX.#*$!&MSC_RefURL=http://search.yahoo.com/search?p=example+phrase&fr=yfp-t-500&toggle=1&cop=&ei=UTF-8

[edited by: Receptional at 9:15 am (utc) on Oct. 10, 2006]
[edit reason] Lots of specifics - nearly enough to get your bank details! I Examplified the URL. [/edit]

Receptional

9:24 am on Oct 10, 2006 (gmt 0)



The link is going OUT of the example site, not in from Yahoo. So, it would seem that as the page loads, it dynamically adds the IP number to every hyperlink, along with other variables.

On most servers the IP address is stored in the REMOTE_ADDR environment variable. This variable can be accessed using any server side scripting language, for instance to print an IP on a web page using PHP you could use

<?
echo $_SERVER['REMOTE_ADDR'];
?>

facher

2:35 am on Oct 11, 2006 (gmt 0)

10+ Year Member



What types of languages can this be accomplished with? Thanks so much.

Romeo

12:26 pm on Oct 11, 2006 (gmt 0)

10+ Year Member



Basically, all languages that can interface with a web server -- trough CGI or otherwise -- can do this, like Perl, PHP, python, ruby, java, asp ...

For a basic and small task as that IP address magic, the PHP approach would be the most easy one, as already mentioned by Receptional.

Kind regards,
R.