Hello,
I was wrote some simple code to upload my photo but :rolleyes: when i use loop construction they are not work and give me an error:
Warning: copy( 1): failed to open stream: No such file or directory in h:\appserv\www\u\u.php on line 19
And SOURC CODE is:
<form method="post" enctype="multipart/form-data" action='u.php?upload=1'>
<?
while($num < 5) {
$num++;
print"<INPUT NAME='file$num' TYPE=file><br>";
}
?>
<input type='submit' value='UP'>
</form>
<?
$status = $_REQUEST['upload'];
if ($status=='1')
{
$num = 0;
while($num < 5) {
$num++;
copy("$file$num","uploaded/$file$num_name");
}
}
?>
:bemused: I try to remove Loop in step 2 with uploading with Copy function by writing manual copy i think this stupidway!
But it's work properly ..
I can not found where is my mestak in code above in 2 loop !
😃 stupid WAY !
<form method="post" enctype="multipart/form-data" action='u.php?upload=1'>
<?
while($num < 5) {
$num++;
print"<INPUT NAME='file$num' TYPE=file><br>";
}
?>
<input type='submit' value='UP'>
</form>
<?
$status = $_REQUEST['upload'];
if ($status=='1')
{
copy("$file1","uploaded/$file1_name");
copy("$file2","uploaded/$file2_name");
copy("$file3","uploaded/$file3_name");
copy("$file4","uploaded/$file4_name");
copy("$file5","uploaded/$file5_name");
}
?>
Thanks for all..
and i am happy if any one have answer for me 😉