Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Image upload script issue

$
0
0

Hello

 

I am trying to get the following script to work for uploading images to my websites images folder but keep getting the following error.

 

Parse error: syntax error, unexpected T_VARIABLE in /home/a9865238/public_html/uploads/upload.php on line 3

 

===============================================================================================

upload.html

===============================================================================================

 

<form action="upload.php" method="post" enctype="multipart/form-data">
File: <input type="file" name="filename" />
<input type="submit" value="Upload" />
</form>

 

===============================================================================================

upload.php

===============================================================================================

<?php

$folder = “/home/a9865238/public_html/images/”;
if (is_uploaded_file($HTTP_POST_$FILES['filename']['tmp_name']))  {   
    if (move_uploaded_file($HTTP_POST_$FILES['filename']['tmp_name'], $folder.$HTTP_POST_FILES['filename']['name'])) {
         Echo “File uploaded”;
    } else {
         Echo “File not moved to destination folder. Check permissions”;
    };
} else {
     Echo “File is not uploaded.”;
$name=$_FILES['file']["name"];
$path=$_FILES['file']["tmp_name"];
$destination="upload/".$name;
 
move_uploaded_file($path,$destination)?"file moved":"file not moved";
}; 
?>
 
 
Regards
Ant

Viewing all articles
Browse latest Browse all 13200

Trending Articles