unexpected $end
Posted: Fri Aug 11, 2006 11:09 pm
ok well i have a bunch of files that i dont want users to be able to access unless the install files are deleted. each file is formated like so:
I created a simple script to test to see if the install directory exists:
And rather than adding that code to each file, i had planned to add the code to the header and footer. For example header.php would include
and footer.php would have
i thought this would work but i get an error
is that infact the reason? if so, is there any easy way of doing what i want rather than adding that code to each file?
Code: Select all
<?php
include("header.php");
include("config.php");
//code
//more code
//even MORE code
include("footer.php");
?>Code: Select all
<?php
$dir = "install/";
if (is_dir($dir)) {
echo "THE INSTALL DIRECTORY EXISTS, YOU MUST REMOVE IT BEFORE YOU CONTINUE.";
}
else{
echo "THE INSTALL DIRECTORY DOES NOT EXIST";
}
?>Code: Select all
<?php
$dir = "install/";
if (is_dir($dir)) {
echo "THE INSTALL DIRECTORY EXISTS, YOU MUST REMOVE IT BEFORE YOU CONTINUE.";
}
else{
?>Code: Select all
<?php
}
?>i assume its because of the open else {Parse error: syntax error, unexpected $end in c:\www\toplist\header.php on line 7
is that infact the reason? if so, is there any easy way of doing what i want rather than adding that code to each file?