Please HELP me
| From: | Rausch Alexandru | Date: | Sun, 27 Jul 2003 02:50:57 +0000 |
| Subject: | Please HELP me | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-157078@lists.php.net to get a copy of this message | ||
I have some problem with uploading a file from my harddisk using a ftp connection.
Here are the 2 files:
test.php contains the form:
<table>
<form method="get" action="test2.php"
enctype="multipart/form-data">
<tr class=cen>
<td>Titlu gif</td>
<td> :: </td>
<td><input type="file" name="util" class=form1><br><input
type="submit" value="expediaza"</td>
</tr>
</form>
</table>
and test2.php is the script for upload :
<?
$ftp_server="*****";
$con = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($con, "*****", "*******");
if ((!$con) || (!$login_result)) {
echo "FTP connection has failed!";
echo "Attempted to connect to $ftp_server";
$error=1;
} else {
echo "Connected to $ftp_server <br>";
}
$util=strtolower($util);
$destination="tit.gif";
if(ftp_put($con, $destination, $util, FTP_BINARY)){echo "OK ,am pus titlul <br>";}
else{ echo "eroare<br>";$error=1;}
?>
Thanks in advanced