Quick help for a quick peice of script for a php newb

 <?php
$id=basename($id);
if(!$id)
include("main.php");
else
include("error.php");
?>

ok heres my prob, i’m new to php so bear with me, I have this php code at the moment on www.sporadicmedia.com/indexphp.php I have 2 php files(main.php and main2.php), that I want to be able to display, so when i link to [url=“http://www.sporadicmedia.com/indexphp.php?id=main2.php”]www.sporadicmedia.com/indexphp.php?id=main2.php it will be displayed, my code al works until I try to implement an error page, so if the page doesnt exist , error.php will be displayed in the set area

ok so heres what i want advice on. I dont realy know how to implement an error page that will apear if the page doesnt exist e.g. www.sporadicmedia.com/indexphp.php?id=kiruparocks

how do I adjust my code to make this happen. :slight_smile:

i cant reply because im going out now, thx in advance, I will come back to thread tommorow. :stuck_out_tongue: