<?php
$IP = $_SERVER['REMOTE_ADDR'];
echo "document.write('" . $IP . "');";
echo "var IP = '" . $IP . "';";
?>