|
· AniB. Newsletter
|
|
|


|
|
|


|
· DBGT NETWORK
|
|
|
•
Tutorials: PHP: Custom 404 Page
PHP is short for Post Hypertext Peripheral Coding. It's a great programming language that lets you do many things never thought possible. You can change your layout without having to edit every single page of your site. It's not complicated to learn if you're familiar to SSI and it's very handy. Before you convert anything to PHP make sure your host supports PHP or else it won't work. Free web hosts such as: FreeWebsites.com, Geocities, Angelfire, etc. do not support PHP!
The code below lets you have your own custom 404 page not found error page.
<?php
$extension = ".html";
$link = "http://www.domain.com/$id$extension";
flush();
$fp = @fopen($link, "r");
if (!$fp) { include("404$extension"); }
else { fclose($fp); include("$id$extension"); }
?>
1st step: Change ".html" to the file extension you use(most people won't need to change this but some people preffer to use .txt or .htm for the files they include), change "http://www.domain.com" to your own domain name, and finally change "$id" to the string you use to call your html page (example: our site uses index.php?dbgt=page_here I would change $id to $dbgt).
2nd step: Place the modified code onto your index.php (or main.php, home.php, e.t.c.) where you would normally include your content file.
3rd step: Now create a page called "404.html" (or 404.txt for those of you who preffer it), this page will have your own message with images to display a custom 404 page.
|
|
|
|
|

[
Home -
Staff Login -
FAQs -
Link Us -
Contact -
Privacy Policy -
Terms of Use -
Copyright -
Viewing -
Statistics
]
Dragon Ball, Dragon Ball Z, and Dragon Ball GT © 2002 BIRD STUDIO/ SHUEISHA, TOEI ANIMATION. Licensed by FUNimation® Productions, Ltd. All Rights Reserved.
Dragon Ball, Dragon Ball Z, and Dragon Ball GT and all logos, character names and distinctive likenesses thereof are trademarks of TOEI ANIMATION.
All information on this web site is solely for DBGTN.com unless otherwise stated. Not to be mistaken for the official site, DBGTN.com is strictly a fan site where by no infringement is intended.
Page loaded in 0.185944 seconds.
|