Jump to content
MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. ×

How do I create a page which shows my ip?


Recommended Posts


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 by CrazyDoctor
Link to post
Share on other sites

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.

Link to post
Share on other sites

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 :ph34r:

Edited by VideoRipper
Link to post
Share on other sites
  • 3 weeks later...

WOW Thank you guys!

You really helped me alot!

I found this site which shows my IP.

www.seemyip.com

I 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,

Link to post
Share on other sites

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.

Link to post
Share on other sites

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?

Link to post
Share on other sites

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.

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...