CrazyDoctor Posted June 15, 2010 Posted June 15, 2010 Hi All,I want to create such a page like in this websitehttp://www.showmyip.com/How do I do that?In a simple description, I want to create a page on my website which shows my vistors their IP address and if possible there mac address to.Many Thanks!
cluberti Posted June 15, 2010 Posted June 15, 2010 A quick search turns up literally thousands of links on how to do this, and I'm sure at least a few are relevant.
CrazyDoctor Posted June 15, 2010 Author Posted June 15, 2010 (edited) A quick search turns up literally thousands of links on how to do this, and I'm sure at least a few are relevant.WOW thanks!I didn't know that this code is written by java!What about server side programing languages?If you have more things that might help me, please add them too.Best Regards, Edited June 15, 2010 by CrazyDoctor
Tripredacus Posted June 15, 2010 Posted June 15, 2010 You can also use the PHP var .$REMOTE_ADD, as noted here:
CoffeeFiend Posted June 15, 2010 Posted June 15, 2010 I didn't know that this code is written by java!It isn't. Java and Javascript are unrelated, even though they sound alike. Javascript is interpreted by the browser (IE/Firefox/Chrome/Safari/etc). Java is something totally different.What about server side programing languages?Depends on the particular server-side language you want.Either ways, a quick google search turns up countless relevant results.
VideoRipper Posted June 15, 2010 Posted June 15, 2010 (edited) Here's another PHP-script (which also shows you some other details):<?php $text='<html><head><title>PHP Environment</title></head><body>'. '<table style="border-collapse: collapse;" cellpadding="1">'; foreach ($_SERVER as $key => $val) $text.='<tr onMouseOver="this.style.backgroundColor=\'AAAABB\';" '. 'onMouseOut="this.style.backgroundColor=\'transparent\';">'. '<td style="font-weight: bold; border-right: 2px solid #000000;">'. $key.'</td><td style="width: 100%;">'. (is_array($val)?nl2br(print_r($val,true)):$val).'</td></tr>'; $text.='</table>'; echo $text.'</body></html>';?>...and how it is executed can be seen by pressing this link Edited June 15, 2010 by VideoRipper
CrazyDoctor Posted July 6, 2010 Author Posted July 6, 2010 WOW Thank you guys!You really helped me alot!I found this site which shows my IP.www.seemyip.comI tried to look over it's code to understand the function who finds my IP but I can't find anything.It seems like part of the code is hidden from visitor, am I right?How does this site works and build?What function and language does this site use in order to detact my IP?Best Regards,
cluberti Posted July 6, 2010 Posted July 6, 2010 Looks like the site is getting the data server-side in the initial GET request (if I funnel myself through a proxy, it gets the proxy's address, rather than running a script on the local client). Probably server-side PHP before the page is served, given it's an Apache webserver on CentOS Linux reporting itself as PHP 5.2.11.
CrazyDoctor Posted July 7, 2010 Author Posted July 7, 2010 Looks like the site is getting the data server-side in the initial GET request (if I funnel myself through a proxy, it gets the proxy's address, rather than running a script on the local client). Probably server-side PHP before the page is served, given it's an Apache webserver on CentOS Linux reporting itself as PHP 5.2.11.I guess that I can't see the code (PHP) of the this site? do I?I tried to get view source but nothing like PHP.Is what I see the outcome of the PHP code that run on the site's server?
cluberti Posted July 7, 2010 Posted July 7, 2010 Yes, unless you have access to the webserver's disk itself, you're not going to see the PHP running on the back end, similar to how you aren't going to see the ASP.NET running on the back end of an aspx page.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now