GetDotted Domains

Viewing Thread:
"Damn PHP..."

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.

Tue 07/05/02 at 01:06
Regular
Posts: 787
Ok, I'm teaching myself php as I go along here, so this could be a really obvious error that i've missed, but anyway...

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...

echo("");
} else {
echo "">"
} ?>

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!!!!!!
Tue 07/05/02 at 23:13
Regular
"Eff, you see, kay?"
Posts: 14,156
Heh, believe me, I know the feeling.
Tue 07/05/02 at 09:09
Regular
"How Handy."
Posts: 2,631
Cheers, what i wrote makes no sense at all now, yet meade perfect sense when i wrote it...
Tue 07/05/02 at 07:23
Regular
"Eff, you see, kay?"
Posts: 14,156
echo "">"


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

HINT:

is just a quick way of writing

So, it should be this:

echo "$file";
Tue 07/05/02 at 01:06
Regular
"How Handy."
Posts: 2,631
Ok, I'm teaching myself php as I go along here, so this could be a really obvious error that i've missed, but anyway...

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...

echo("");
} else {
echo "">"
} ?>

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!!!!!!

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

First Class!
I feel that your service on this occasion was absolutely first class - a model of excellence. After this, I hope to stay with Freeola for a long time!
I've been with Freeola for 14 years...
I've been with Freeola for 14 years now, and in that time you have proven time and time again to be a top-ranking internet service provider and unbeatable hosting service. Thank you.
Anthony

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.