Forum Moderators: coopster

Message Too Old, No Replies

Need Some Help In Include....

help php

         

Taran

6:33 pm on Jan 5, 2004 (gmt 0)

10+ Year Member Top Contributors Of The Month



<?php include ("$id.htm");?>
i use this thing in my page to put other pages in it.. i want to make it like that if some one types a worng page $id he is moved to a 404 page.

Thank You.

jatar_k

6:40 pm on Jan 5, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld Taran,

I guess you could use is_file [ca.php.net].

<?
if (is_file("$id.htm")) include ("$id.htm");
else include ("404.htm");
?>

assuming the name of your 404 file is 404.htm

Taran

7:39 pm on Jan 5, 2004 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thanks Mr. Moderator... i really need that thing.. some people or even webmaster try to break site rules would have a big slap on their face.

Thank You Again