
December 23rd, 2003, 10:27 AM
|
|
Junior Member
|
|
Join Date: Dec 2003
Location: Madison, WI
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Parse Error T_ECHO
Quote: | Parse error: parse error, unexpected T_ECHO in /Library/WebServer/Documents/clients/whg/admin/upload2.php on line 13 |
I've been getting this or similar errors more and more frequently. It seems whenever I use snippets of code from other sources this is my default error message.
My latest attempt is to create a simple file upload. I'm using the following code as described on php.net
Quote:
Page 1
<form enctype="multipart/form-data" action="upload2.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="30000">Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
Page 2
$uploaddir = "/Library/WebServer/Documents/gallery/";
$uploadfile = $uploaddir. $_FILES['userfile']['name'];
echo "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
__ echo "File is valid, and was successfully uploaded. ";
__ echo "Here's some more debugging info:<br>";
__ print_r($_FILES);
} else {
__ echo "Possible file upload attack!_ Here's some debugging info:<br>";
__ print_r($_FILES);
}
echo "</pre>"; |
I'm using php v. 4.3.0 and have hi-lighted line 13, which is a simple php echo command. I've also noticed with this error - it occurs even if the code has not been parsed. Meaning the condition may result to false, but because it's some kind of parse error, the page displays this error anyway.
Any thoughts?
|