Help me with this F**k error, I´ve no idea
Posted: Sun Apr 27, 2003 2:24 pm
I was trying to upload a file and php show me this.
Parse error: parse error, unexpected T_STRING in C:\Php Ide\nusphere\PHPEd\Foro 2.0\up.php on line 6
This is the code:
up.php
and the upload.html
Parse error: parse error, unexpected T_STRING in C:\Php Ide\nusphere\PHPEd\Foro 2.0\up.php on line 6
This is the code:
up.php
Code: Select all
<?php
if (! is_uploaded_file($userfile))
{
unlink($userfile);
$error = "Nada";
} // Line 6 --> Error???????????
else {
//a file was uploaded
$maxfilesize=10240;
if ($userfile_size > $maxfilesize) {
$error = "file is too large";
unlink($userfile);
// assign error message, remove uploaded file, redisplay form.
} else {
if ($userfile_type != "image/gif" AND $userfile_type != "image/pjpeg") {
$error = "This file type is not allowed";
unlink($userfile);
// assign error message, remove uploaded file, redisplay form.
} else {
//File has passed all validation, copy it to the final destination and remove the temporary file:
@ move_uploaded_file($userfile_type,"prueba/".$userfile_name);
unlink($userfile);
print "File has been successfully uploaded!";
exit;
}
}
}
?>Code: Select all
<html>
<form action="up.php" method="POST" enctype="multipart/form-data">
submit this file: <input type=file name="userfile"><br>
<input type=submit><br>
</form>
</html>