Page 1 of 1

Get Server Response Header and then only echo Server OS?

Posted: Sun Sep 02, 2007 12:11 am
by JAB Creations
I'm going off the example on this page...
http://us3.php.net/manual/en/function.get-headers.php

So I figured I could do something like this...

Code: Select all

<?php 
$thisserver = 'http://' . $_SERVER['HTTP_HOST'];
print_r(get_headers($thisserver['Server']));
echo get_headers($thisserver);?>
To get (from the example page) something like this...
Apache/1.3.27 (Unix) (Red-Hat/Linux)

How should I correct my code?

Posted: Sun Sep 02, 2007 12:40 am
by s.dot
Maybe you're looking for the server signature. $_POST['SERVER_SIGNATURE'].

I tried it on command line, but it wasn't set.

Posted: Sun Sep 02, 2007 12:47 am
by JAB Creations
While your suggestion didn't work I did a Google based on what you suggested and figured it out so thank you none-the-less! 8)

Code: Select all

<?php echo $_SERVER['SERVER_SOFTWARE']; ?>

Posted: Sun Sep 02, 2007 1:03 am
by s.dot
Sweet, I'll save that one in my memory bank.