Get Server Response Header and then only echo Server OS?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Get Server Response Header and then only echo Server OS?

Post 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?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Post 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']; ?>
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Sweet, I'll save that one in my memory bank.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply