<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";
?>
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'];