What's my ip? v1.0

By A^1^T^E^A^M on May 02, 2009

Screenshot
Image

<html>
<body>
<b>Your IP address is:</b>
<?php

$ip=$_SERVER['REMOTE_ADDR'];
echo "$ip"; 
?>
<b>Name server:</b>
<?php

$ip=$_SERVER['REMOTE_ADDR'];
$ip2=$_SERVER['HTTP_REMOTE_HOST'];
if ($ip2=="")
 echo "$ip"; 
else
  echo "$ip1";  
?>
<b>Remote port:</b>
<?php

$port=$_SERVER['REMOTE_PORT'];
echo "$port"; 
?>
<b>Browser:</b>
<?php
   $browser=$_SERVER['HTTP_USER_AGENT'];
echo "$browser"; 
?>

Comments

Sign in to comment.
A^1^T^E^A^M   -  Oct 07, 2009

@bnc It's not full page, also and the sidebar is removed from the picture. Everything that I want is to see people what informations generate this code, not the design :)

 Respond  
bnc   -  Aug 15, 2009

Design and... >> What design? :D

 Respond  
PATX   -  Jun 13, 2009

i may be mistaken but couldnt you do this with javascript (or any other lan for that point...)? anyway i dont really like php but good script. if i were to do it id choose python, buts dta just me.

 Respond  
Vox91   -  May 03, 2009

you also could echo the *:

like:

 echo "<b> Browser: </b>"; 

then you will get less opening and closing from php.
but although nice code if you are a beginner :)

edit;

also why working with variables in this script, it is shorter I know, but not need in this script.

And try to get your variables set at the beginning of your script like:

$ip = $_SERVER['REMOTE_ADDR'];
$ip = $_SERVER['REMOTE_ADDR'];
$ip2 = $_SERVER['HTTP_REMOTE_HOST'];
$port = $_SERVER['REMOTE_PORT'];
$browser = $_SERVER['HTTP_USER_AGENT'];
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.