Skip to content

Instantly share code, notes, and snippets.

@dave1010
Created April 11, 2011 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dave1010/913402 to your computer and use it in GitHub Desktop.
Save dave1010/913402 to your computer and use it in GitHub Desktop.
See what web server a site is using and add it to a DB table
<?php
ob_start();
passthru('curl -I http://www.reddit.com | grep Server | sed "s/Server: //"');
$server = ob_get_clean();
// http://xkcd.com/327/
mysql_query("INSERT INTO servertypes (server) VALUES '$server'");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment