i THINK they are saying that one page1, they want a link that takes them to page2, and displays the IP of the person who clicked the link..
IF that is the case, the matter is quite simple, but also redundant, as you can just include their IP on the main page with
<?
$ip = $_SERVER['REMOTE_ADDR'];
echo $ip;
?>