have a look at the manual page on predefined variables
the ones you want are under $_SERVER - they are REMOTE_ADDR and SCRIPT_URL
to call these, use the following syntax;
$ip = getenv("REMOTE_ADDR");
$thispage = getenv("SCRIPT_URL");
you can see the output of all the predefined variables by creating a page like this;
<?php
phpinfo();
?>