Archive

Posts Tagged ‘web programming’

Fun with browser error pages

October 26th, 2007

So, I though it would be interesting to mimic browser behavior with error pages. I decided I needed to make a page that looked exactly like the Firefox Server-not-found page. I managed to copy the source using Firebug, and I extracted the css out of the jar files on my system. Anyway, I ended up with some source for IE and some source for Firefox.

Test this in IE and Firefox

I left little invisible links in each one (search for ‘Supplies’ on the page). I also removed all the default javascript from the Firefox version and replaced the Try Again action with a simple reload one-liner.

Then, I just wrote some awesome PHP to take care of which one to load, and called it index.php:


<?php
if (preg_match('/MSIE/i', $_SERVER['HTTP_USER_AGENT'])) {
  readfile("errortest-ie.html");
} else {
  readfile("errortest-ff.html");
}
?>

And we’re done. Not bad, eh?


Uncategorized , , , , , ,