The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
I'm editing a file I've stole of Rob that displays the contents of a folder (like the default page apache throws out if their isnt an index.*) and have to a problem. The file is called index.php, so i dont wont it to list index.php in the file listings, so the easiest way to do it (or so i thought) is to just leave a space if the file is index.php..
so, i come up with this...
if ($file == "index.php") {
echo("");
} else {
echo "">=$file?>"
} ?>
To talk you through it, if the file is index php, then leave blank. Otherwise, output (if the file is a directory it needs to add a / to the end of the url because of the way my servers set up, ie. wrong) then output the filename and .
Sounds easy enough, but I cant see for the life of me what's up with that line, when i run the page i get the error:
Parse error: parse error, unexpected '?' in c:program filesapache groupapachehtdocsindex.php on line 84
HEEEEEEEEEEELLLLLLLLLPPPPPP!!!!!!
You've got how to output variables mixed up. The bit you're running here is actually inside PHP, so to output the variable you should just put $var, not =$var?>
HINT:
=$var?> is just a quick way of writing
So, it should be this:
echo "$file";
I'm editing a file I've stole of Rob that displays the contents of a folder (like the default page apache throws out if their isnt an index.*) and have to a problem. The file is called index.php, so i dont wont it to list index.php in the file listings, so the easiest way to do it (or so i thought) is to just leave a space if the file is index.php..
so, i come up with this...
if ($file == "index.php") {
echo("");
} else {
echo "">=$file?>"
} ?>
To talk you through it, if the file is index php, then leave blank. Otherwise, output (if the file is a directory it needs to add a / to the end of the url because of the way my servers set up, ie. wrong) then output the filename and .
Sounds easy enough, but I cant see for the life of me what's up with that line, when i run the page i get the error:
Parse error: parse error, unexpected '?' in c:program filesapache groupapachehtdocsindex.php on line 84
HEEEEEEEEEEELLLLLLLLLPPPPPP!!!!!!