<?php
//"ip.php" example- display user IP address on any page
header("content-type: application/x-javascript");
$serverIP=$_SERVER['REMOTE_ADDR'];
echo "document.write(\"Your IP address is: " . $serverIP . "\")";
?>
to call the php file in html file like
<script type="text/javascript" src="ip.php"></script>
Hope it will be helpful.
Anil Kumar Panigrahi
Nice tip
ReplyDelete