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

**URL:** <https://forum.kirupa.com/t/quick-help-for-a-quick-peice-of-script-for-a-php-newb/107679>\
**Category:** Uncategorized\
**Created:** [April 17, 2004, 10:55pm UTC](https://forum.kirupa.com/t/quick-help-for-a-quick-peice-of-script-for-a-php-newb/107679 "2004-04-17T22:55:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![peveedotcom](https://avatars.discourse-cdn.com/v4/letter/p/4491bb/32.png) [@peveedotcom](https://forum.kirupa.com/u/peveedotcom)\
**Post date:** [April 17, 2004, 10:55pm UTC](https://forum.kirupa.com/t/quick-help-for-a-quick-peice-of-script-for-a-php-newb/107679/1 "2004-04-17T22:55:25Z")

</div>

```php
 <?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](http://www.sporadicmedia.com/indexphp.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](http://www.sporadicmedia.com/indexphp.php?id=kiruparocks)

how do I adjust my code to make this happen. 🙂

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