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'];
?>
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 08:45 AM.
█ Trill Hosting - Cheap SSL, Cheap Web Hosting, Register Cheap Domains, Cheap Blog Hosting
█ www.trillhosting.com | support@trillhosting.com
█ Hosting Plans | Write To Us | Support | Client Area | About Us
CodeCall Blog | CodeCall Wiki
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
█ Trill Hosting - Cheap SSL, Cheap Web Hosting, Register Cheap Domains, Cheap Blog Hosting
█ www.trillhosting.com | support@trillhosting.com
█ Hosting Plans | Write To Us | Support | Client Area | About Us
CodeCall Blog | CodeCall Wiki
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>![]()
█ Trill Hosting - Cheap SSL, Cheap Web Hosting, Register Cheap Domains, Cheap Blog Hosting
█ www.trillhosting.com | support@trillhosting.com
█ Hosting Plans | Write To Us | Support | Client Area | About Us
CodeCall Blog | CodeCall Wiki
Thanks bro, you're awesome. How long have you been programming?
np mate..
umm.. i think umm.. maybe 2,5 years for now![]()
█ Trill Hosting - Cheap SSL, Cheap Web Hosting, Register Cheap Domains, Cheap Blog Hosting
█ www.trillhosting.com | support@trillhosting.com
█ Hosting Plans | Write To Us | Support | Client Area | About Us
CodeCall Blog | CodeCall Wiki
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum