MSFN Forum: How do I create a page which shows my ip? - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How do I create a page which shows my ip? Rate Topic: -----

#1 User is offline   CrazyDoctor 

  • Junior
  • Pip
  • Group: Members
  • Posts: 89
  • Joined: 16-February 10
  • OS:none specified

Posted 15 June 2010 - 08:16 AM

Hi All,

I want to create such a page like in this website
http://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!


#2 User is offline   cluberti 

  • Gustatus similis pullus
  • Group: Supervisor
  • Posts: 11,208
  • Joined: 09-September 01
  • OS:Windows RT
  • Country: Country Flag

Posted 15 June 2010 - 08:24 AM

A quick search turns up literally thousands of links on how to do this, and I'm sure at least a few are relevant.

#3 User is offline   CrazyDoctor 

  • Junior
  • Pip
  • Group: Members
  • Posts: 89
  • Joined: 16-February 10
  • OS:none specified

Posted 15 June 2010 - 08:29 AM

View Postcluberti, on 15 June 2010 - 08:24 AM, said:

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,

This post has been edited by CrazyDoctor: 15 June 2010 - 08:36 AM


#4 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,690
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 15 June 2010 - 11:50 AM

You can also use the PHP var .$REMOTE_ADD, as noted here:
http://www.msfn.org/...gnature-ip-sig/

#5 User is offline   CoffeeFiend 

  • Coffee Aficionado
  • Group: Super Moderator
  • Posts: 5,399
  • Joined: 14-July 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 15 June 2010 - 03:16 PM

View PostCrazyDoctor, on 15 June 2010 - 08:29 AM, said:

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.

View PostCrazyDoctor, on 15 June 2010 - 08:29 AM, said:

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.

#6 User is offline   VideoRipper 

  • CSI Eastwood City
  • PipPipPip
  • Group: Members
  • Posts: 330
  • Joined: 11-February 10
  • OS:none specified
  • Country: Country Flag

Posted 15 June 2010 - 04:23 PM

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:

This post has been edited by VideoRipper: 15 June 2010 - 04:24 PM


#7 User is offline   CrazyDoctor 

  • Junior
  • Pip
  • Group: Members
  • Posts: 89
  • Joined: 16-February 10
  • OS:none specified

Posted 05 July 2010 - 06:57 PM

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,

#8 User is offline   cluberti 

  • Gustatus similis pullus
  • Group: Supervisor
  • Posts: 11,208
  • Joined: 09-September 01
  • OS:Windows RT
  • Country: Country Flag

Posted 05 July 2010 - 09:39 PM

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.

#9 User is offline   CrazyDoctor 

  • Junior
  • Pip
  • Group: Members
  • Posts: 89
  • Joined: 16-February 10
  • OS:none specified

Posted 07 July 2010 - 07:52 AM

View Postcluberti, on 05 July 2010 - 09:39 PM, said:

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?

#10 User is offline   cluberti 

  • Gustatus similis pullus
  • Group: Supervisor
  • Posts: 11,208
  • Joined: 09-September 01
  • OS:Windows RT
  • Country: Country Flag

Posted 07 July 2010 - 07:58 AM

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.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy