This is basic code to check ip, host and browser.
If you wanna to check ip, you can use global variable:
Code:
$_SERVER["REMOTE_ADDR"];
To check host, you can use also global variable:
Code:
$host=gethostbyaddr($ip)
And at the end to check browser:
Code:
$_SERVER["HTTP_USER_AGENT"];
If we integrate this variables we can create code like this:
Code:
<?php
$ip=$_SERVER["REMOTE_ADDR"];
$host=gethostbyaddr($ip);
$browser=$_SERVER["HTTP_USER_AGENT"];
echo '<center>
<span>Your IP:';
echo $ip;
echo '
Your host:';
echo $host;
echo '
Your browser:';
echo $browser;
echo '</span></center>';
?>
First three lines declarate new variables: ip, host, browser. Rest - echo code show result on the screen.
Created by m1chu
|