Want to get and then show the IP of the visitor who’s browsing your site? Here’s the way
- To get the IP – for storing purpose or anything, you can use this piece of codes;
<?php
$visitorip = $_SERVER["REMOTE_ADDR"];
?>
$visitorip = $_SERVER["REMOTE_ADDR"];
?>
- If you want to show it, you may do so by putting these codes;
<?php
echo “Your IP is ” . $visitorip;
?>
echo “Your IP is ” . $visitorip;
?>
- Or the easier way;
<?php
echo “Your IP is ” . $_SERVER["REMOTE_ADDR"];
?>
echo “Your IP is ” . $_SERVER["REMOTE_ADDR"];
?>
- And as the result, you will get the following;
Your IP is 38.107.191.117
Comment?
»
Leave a comment
ajwa . Naj . Wawa . 26 . 











