|
|
|
ช่วยดูโคดอัพโหลดภาพเยอะๆให้หน่อยครับอัพโหลดไม่ได้คับผ่านตัวแปร Array |
|
|
|
|
|
|
|
<?
$nfile = 6;
?>
<FORM enctype="multipart/form-data" action="a.php" method=post>
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
<?
$nfile = 6;
For ($i = 1 ; $i <= $nfile ; $i++) {
echo "File $i <input name='userfile[]' type=file><br>";
}
?>
<input type="submit" VALUE=" µ¡Å§Êè§ ">
</form>
==================================================================================
a.php
$uploaddir = './photo/'; //ที่เก็บรูปภาพ
foreach ($_FILES["userfile"]["error"] as $key => $error) {
if ($error == 0 ) {
$tmp_name = $_FILES["userfile"]["tmp_name"][$key];
$name = $_FILES["userfile"]["name"][$key];
$size = $_FILES["userfile"]["size"][$key];
$type = $_FILES["userfile"]["type"][$key];
move_uploaded_file($tmp_name, "$uploaddir$name");
echo "$key : $type $size Byte $name <br> \n ";
}
}
|
|
|
|
|
Date :
16 ก.พ. 2550 04:41:49 |
By :
deawx |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณครับ
|
|
|
|
|
Date :
16 ก.พ. 2550 13:13:09 |
By :
frame |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|