...

View Full Version : file include not getting proper error if !file exists



DataTalk
12-06-2010, 11:50 AM
For some reason I cant get this to work??

if show file = yes; and if the file exists "include the file" - if we cant find the file "error file not found"
if show file = no; show the html code <!-- file disabled -->


<?php
if($showinclude7 != 'no')
if(!file_exists{include "$fileinclude7"; } {
die ("File not found");}
else { echo"<!-- file didabled-->";}
?>

Lamped
12-06-2010, 11:54 AM
if ($showinclude7 != 'no') {
if (file_exists($fileinclude7)) {
include($fileinclude7);
} else {
die('File not found');
}
} else {
echo('<!-- File disabled -->');
}

DataTalk
12-06-2010, 12:12 PM
Thanks - was having a PHP brain fart on this logic!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum