# Ftp upload problem

**URL:** <https://forum.kirupa.com/t/ftp-upload-problem/54885>\
**Category:** Uncategorized\
**Created:** [June 18, 2004, 2:52pm UTC](https://forum.kirupa.com/t/ftp-upload-problem/54885 "2004-06-18T14:52:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mid\_ori](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@mid\_ori](https://forum.kirupa.com/u/mid_ori)\
**Post date:** [June 18, 2004, 2:52pm UTC](https://forum.kirupa.com/t/ftp-upload-problem/54885/1 "2004-06-18T14:52:30Z")

</div>

hi all.

I’m having problems with a php ftp uploader can somebody look at my script and help me find out why it won’t work;

```auto

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<form action="myupload.php" method=post enctype="multipart/form-data"> 
submit this file: <input type=file name="userfile"><br> 
<input type=submit><br> 
</form> 
</body>
</html>

```

```php

<? 
// In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of $_FILES. 
if(!empty($_FILES["userfile"])) { 
    $uploaddir = "/ftp/" // 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!");
    }
} 
?>

```

the error i get is: Parse error: parse error in /home/iceni/public\_html/myupload.php on line 6

all help welcome
