Hi again all,
I'm not really 100% sure what I did here but something messed up overnight in my script, and now I'm trying to find an alternate way to do the following:
I want to include a file depending on user given input, for example, include ('whatever.php'), except the "whatever" part of "whatever.php" has to be a variable. This is what I've come up with so far:
include ($content.'.php');
However, it's not working the way I wanted it to (for some reason I'm getting errors today.
ERROR: include(.php) [function.include]: failed to open stream: No such file or directory
Yesterday I was assisted to create this code (for which that include is included in) and it is as follows:
<?php
$content = (isset($_GET['con']) ? $_GET['con'] : NULL);
if (($content) == NULL) {
include ('home.php');
}
else {
include ($content.'.php');
}
?>
It was meant to function as my home page. If a user goes to index.php ($content being null) then it should bring them to the home page. Otherwise, take the value of $content and tack a .php on the end and go there. As long as I am running in the else statement on my page, it works fine, but as soon as I try to access index.php alone when $content is NULL, I get the error / notice posted above, however it doesn't really affect the site too much (over maybe performance, however that could just be my server).
Does anyone have any ideas?