I have some PHP coding which simply makes a path and includes a text file:
Called by
Processed by
I wanted to put some error handling, should a page not exist, but this doesn't work. I get my error message for the file not existing. But it does...
I am using PHP 5 on Apache Server on a Windows machine....
Code:
// Variables $host and $folderPath are included in index pages and taken from varDefs.php4
if(!($_GET)) {
$p = "home";
}
else {
$p = $_GET["p"];
}
$filename_left = '[URL unfurl="true"]http://'.$host.$folderPath.'/inc/'.$p.'/left.inc.php';[/URL]
$filename_testimonials = '[URL unfurl="true"]http://'.$host.$folderPath.'/inc/'.$p.'/testimonials.js';[/URL]
$filename_right = '[URL unfurl="true"]http://'.$host.$folderPath.'/inc/'.$p.'/right.inc.php';[/URL]
Called by
Code:
<?echo '<a href="[URL unfurl="true"]http://'.$host.$folderPath.'?p=home">Home[/URL] Page</a>' ?>
Processed by
Code:
include($filename_right);
I wanted to put some error handling, should a page not exist, but this doesn't work. I get my error message for the file not existing. But it does...
Code:
if (file_exists($filename_left)) {
include($filename_left);
} else {
echo "There has been an error. Click here to inform the webmaster.";
}
I am using PHP 5 on Apache Server on a Windows machine....