home
  news archive
  pr
  tutorials / how to's
  404 gallery
  downloads
  links
  about




psymbolic.com




132 funky
+81 freaky
+ 75 funny
+94 misc
= 382404s total




 


1.subfuse.net
2.chairboy.com
3.bienenjagd.de
4.head-design.net...
5.i.tubescan.com...




1256079 visitors so far.



©2002-2006.
please do not reproduce/redistribute any material (text or design) from this page without my explicit written permission.
random images on your 404

IMPORTANT: this is a php tutorial. So you'll need PHP on the server to be able to run this script. The bold text shows where you have to customize the script.



<?
$directory = "$DOCUMENT_ROOT/404s"; //where are your 404 images?
$handle = opendir($directory); // open the dir
while ($file = readdir ($handle))
{
if ($file != "." && $file != "..")
{$filecount++;}}
srand((double)microtime()*1000000);
$random = rand(1,10); // 10 is the amount of images

?>

<!-- show -->

<img src="<? echo $directory."/0".$random ?>.jpg" border="0">

1. Copy and paste that code wherever you want the random images to appear on your 404 page.
2. Create a directory called e.g. "404s" and put your images in.
3. Rename your images to 01.jpg, 02.jpg and so on.
3. If there are more than 10 images, please change the amount ($random = rand (1/numberofyourimages)).
4. Be sure that your 404 page has a .php ending and upload it.

Note: if your images are .gif you have to change the line:

<img src="<? echo $directory."/0".$random ?>.jpg" border="0">
to:
<img src="<? echo $directory."/0".$random ?>.gif" border="0">


I hope that works for you and if it doesn't, email for help at webmistress@404lounge.net.

<----// tutorials