Need help solving a PHP includes problem?

I am reopening a website that I own haven't used it in a few years had everything stored in a backup from 2003. Its a php include script that worked back then but can't seem to get it working now and need some help trouble shooting it.

Here is the string that I am using unedited aside from the domain name.
<?php if($id !=""){ readfile("$id.html");} else{ readfile("http://www.mydomain.com/php-bin/news/news.php");} ?>

($id !="") - tells the page that this is the location of the folder/file name in the link:
<a href="main.php?id=misc/folder/index">Example</a>

{ readfile("$id.html");} - Tells the page that the file is a .html file and the name should replace the variable $id

else{ readfile("http://www.mydomain.com/php-bin/news/news.php");} ?> - Basically if the link is broken go to this page.

The link itself is pretty easy too.
<a href="main.php - the page the content will be targeted to

?id=misc/folder/index"> - the page location and name.

Now all it does is target the news page. The links still appear in the browser as it should (http://www.mydomain.com/main.php?id=misc/folder/index) It is the news page content that comes up.

I have even added <?include("$id.html");?> to see if it is targeting incorrectly or I forgot something have even put in <?php include("$id.html");?> but to no avail.

What am I doing wrong how can I correct this and make this work I really want to continue using this script as it allows me minimal editing when adding pages.

I have done a google search and I keep coming up with nothing for this particular script.
Sorry unedited main script here:
<?php if($id !=""){ readfile("$id.html");} else{ readfile("http://www.anixero.com/php-bin /news/news.php");} ?>
Sorry Colanth that didn't work I appreciate it though.
 
Back
Top