Well this is simple trick. Well i can't say it's a trick but.. well..
The way you see your IP
Code:<?php
echo $_SERVER['REMOTE_ADDR'];
?>
Last edited by Jaan; 01-17-2008 at 06:45 AM.
Hey there,
Instead of outputting the IP address, you could store it in a variable and then get the hostname of the user.
I had to use this on my coldfusion server because the host blocked the Java(CreateObject) method.Code:<?php
$hostname = gethostbyaddr($_GET['ipAddress']);
echo $hostname;
?>
Sincerely,
Travis Walters
spammy sig deleted
What's the JavaScript method?
But you have to use .shtml extension not .html or .htm because it uses server side includesHTML Code:<html> <head> <script language="JavaScript"> function disp_ip(){ var ip = '<!--#echo var="REMOTE_ADDR"-->'; document.write(ip) } </script> </head> <body> <form> <input type='button' value='Check your Ip' onClick='disp_ip();'> </form> </body> </html>![]()
Thanks bro, you're awesome. How long have you been programming?
np mate..
umm.. i think umm.. maybe 2,5 years for now![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks