0) { if (empty($referrer) || isreferrerokay( $referrer, $invalidprefixes )) $imagepath = $imagedir . $image ; else $imagepath = $imagedir . $altimage; // serve them the nag image $imageinfo = getimagesize( $imagepath ); if ($imageinfo[2] == 1) { $imagetype = "gif" ; } elseif ($imageinfo[2] == 2) { $imagetype = "jpeg" ; } elseif ($imageinfo[2] == 3) { $imagetype = "png" ; } else { header( "HTTP/1.0 404 Not Found" ); exit ; } header( "Content-type: image/$imagetype" ); @readfile( $imagepath ); } else { header( "Location: $homepage" ); } ?>