In message <gtsth5+k...@egroups.com>, Kal Durak
<kal.du...@ironivyinc.com> writes
>I am running virtual servers under Apache.  I have an application that needs 
>to 
>run under several of the servers.  I need it to retrieve the hostname that it 
>is 
>running under.  
>
>I noticed that if you run phpinfo.php, under apache2handler, there is a 
>listing 
>for hostname.  This is exactly what I need, but I haven't been able to find 
>how 
>to retrieve that variable.
>
>Any help would be greatly appreciated.

All the entries in phpinfo, under PHP Variables, can be used in your
code, simply by adding a dollar in front of it.

I see the first entry as 
_REQUEST["phpinfo"] 

You could use that as
echo $_REQUEST['phpinfo'];

or 
echo "<p>The answer is, of course {$_REQUEST['phpinfo']}</p>";

(hope that looks correct in your email!)

-- 
Pete Clark

Got any spare time? Anything you need? Barter in Spain
Join for free at http://BarterWithBart.com

Reply via email to