Forum Moderators: coopster
MY IP ADDRESS - Mozilla/4.73C-CCK-MCD {C-UDP; EBM-APPLE} (Macintosh; U; PPC) - cgi-local/google.cgi - 02/24/03 17:46:38 PST
But the visitors at the site give out the server info.
SERVER IP ADDRESS - PHP/4.0.6 - /cgi-local/google.cgi - 02/24/03 17:46:39 PST
This is from a perl script using an include in a php page.
<?php
include "http://www.domain.com/cgi-local/google.cgi";
?>
wether include nor virtual won't help at all. because in your scenario php would retrieve the file (via the fopen wrapper which is able to handle http) and therefore the cgi script will return your server info.
you've to write a script like the cgi yourself and make a function out of it which will return the line you desire. here is how:
make a php file and put the command phpinfo() [php.net] into it. then uplad the file and request it. it will return tons of information about the php setup on your webserver. locate the PHP Variables sections and pick out the vars interesting for you.
_SERVER["REMOTE_ADDR"] might be interesting for you.
then
echo($_SERVER["REMOTE_ADDR"]); might do the job for you.