note 39084 deleted from function.copy by didou
| From: | didou@php.net | Date: | Fri, 16 Jan 2004 15:41:28 +0000 |
| Subject: | note 39084 deleted from function.copy by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63682@lists.php.net to get a copy of this message | ||
Note Submitter: gabcam@gogo.com.br
----
very simple
upload.hml
----------------------------
<form name="upload" action="upload.php" method="post"
enctype="multipart/form-data">
File 1:<input type="file" name="a[]"
size="60"><br><br>
File 2:<input type="file" name="a[]"
size="60"><br><br>
File 3:<input type="file" name="a[]"
size="60"><br><br>
File 4:<input type="file" name="a[]"
size="60"><br><br>
<input type="submit" name="enviar" value="Enviar arquivo">
</form>
----------------------------
upload.php
----------------------------
<?
for( $i=0 ; $i < count($a) ; $i++ )
{
if((!empty($a_name[$i])) && (is_file($a[$i])))
{
$dir = "/var/www/html/img/";
$dir = $dir.$a_name[$i] ;
if(!copy($a[$i],$dir))
{
print("error: in transfer file $a_name[$i]...<br>\n") ;
}
else
{
print("<h3>send file $a_name[$i] sucess!</h3>");
}
}
}
?>
by yZarc