April 25, 2006

senangnyah !

akhirnya,ngerti juga gwe.hehehe…

2 hari ngoprek2 di google tentang mail() sama upload akhirnya skarang tau juga untuk yg upload :D .tapi untuk yang mail() gwe blom ketemu :( .

——————-uploadgwe1.php————————- 

<body>
<form name="form1" method="post" action="uploadgwe2.php">
<p>Masukkan jumlah file yang ingin di upload Max =9</p>
<p><input name="uploadneed" type="text" id="uploadneed" maxlength="1"></p>
<p><input type="submit" name="submit" value="submit"></p>
</form>

</body>

————————- cut ————————- 

————————- uploadgwe2.php————————- 

 <form name="form1" enctype="multipart/form-data" method="post" action="pretpret.php">
 <p>
  <?
   $uploadneed = $_POST[’uploadneed’];
   for($x=0;$x<$uploadneed;$x++)
     {
  ?>
      <input name="uploadfile<? echo $x; ?>" type="file" id="uploadfile <? echo $x; ?>">
 
 </p>
 <?
 }
 ?>
 <p> <input name="uploadneed" type="hidden" value="<? echo $uploadneed; ?>">
 <input type="submit" name="submit" value="submit"></p>
 
</form>

 ————————-  cut ————————-

 ————————- prepret.php————————-

<body>
<?
$uploadneed = $_POST[’uploadneed’];
for ($x=0;$x<$uploadneed;$x++)
 {
  $file_name=$_FILES[’uploadfile’.$x][’name’];
  $file_name = stripslashes($file_name);
  $file_name = str_replace("’","",$file_name);
 
  $copy = copy($_FILES[’uploadfile’.$x][’tmp_name’],$file_name);
 
  if ($copy)
   {
     echo "$file_name <—- pret pret..berhasil di upload neh crut.. <br>";
   }else{
  
    echo "$file_name  <—- pret pret..cek lagi dong bos ah…..<br>";
        }
}
?>

</body>

 

————————————————————— 

kurang lebihnya seperti itu :D  

 nb: diambil dari berbagai referensi :p ..

Comments »

The URI to TrackBack this entry is: http://yudhipras.blogsome.com/2006/04/25/senangnyah/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.