July 28th, 2008 |
So, this is so easy to do, watch this
<span style="color: rgb(0, 0, 0); font-weight: bold;"><?php</span>
<span style="color: rgb(0, 0, 255);">$ip</span>=<span style="color:
rgb(0, 0, 255);">$_SERVER</span><span style="color: rgb(102, 204, 102);">
[</span><span style="color: rgb(255, 0, 0);">'REMOTE_ADDR'<
/span><span style="color: rgb(102, 204, 102);">]</span>;
<a href="http://www.php.net/echo"><span style="color: rgb(0, 0, 102);
">echo</span></a> <span style="color: rgb(0, 0, 255);">$ip<
/span>;
<span style="color: rgb(0, 0, 0); font-weight: bold;">?></span>
Put this code in some HTML page.
When the user opens that page, the command echo will write its IP address to the page.
That's it.
Subscribe to post feed