Here are some files from an online indicator test I wrote back on 19 July 2003:
HTML Page that user will view (test.html):
<html>
<head>
<title>Online Test</title>
</head>
<body>
<script type="text/javascript" src="test.php?name=laserlight"></script>
</body>
</html>
This is test.php, the php script that it interfaces:
<?php
//echo '<script type="text/javascript">';
echo 'document.write("Name: ' . $_GET['name']
. '<br>IP: ' . $_SERVER['REMOTE_ADDR']
. '<br>Path: ' . $_SERVER['HTTP_REFERER'] . '");';
//echo '</script>';
?>
Try it and see if it works for you.