Parse Error unexpected T_IF
Hi there
Can anyone help me with this code?
<html>
<?
// In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of $_FILES.
if(!empty($_FILES["userfile"])) {
$uploaddir = "/upload/" // set this to wherever
//copy the file to some permanent location
if (move_uploaded_file($_FILES["userfile"]["tmp_name"], $uploaddir . $_FILES["userfile"]["name"]))
{
echo("file uploaded");
} else {
echo ("error!");
}
}
?>
</html>
I get the following error:
Parse error: parse error, unexpected T_IF on line 7 where line 7 is
if (move_uploaded_file($_FILES["userfile"]["tmp_name"], $uploaddir . $_FILES["userfile"]["name"]))
thanks
Adam
|