Jump to content
php.lv forumi

Failu upload


rudzis

Recommended Posts

kaut ko šitik vienkāršu??

 

<?php if($_POST['Submit']=='Pievienot'){
$upload_dir='../files';
$fails='file';
$filename= $upload_dir.'/'.$_FILES[$fails]['name'];

if (@move_uploaded_file($_FILES[$fails]['tmp_name'], $filename))
{ 
   echo 'fails '.$_FILES[$fails]['name'];
   echo ' pievienots<br \>';
 
}else { echo $_FILES[$fails]['name'].' nepievienojaas :(<br \>';
}

}?>

<form name="form1" enctype="multipart/form-data" method="post" action=""><table width="400"  border="0">
 <tr>
   <td colspan="2"><div align="justify">Būtībā var pievienot jebkuru failu. </div></td>
   </tr>
 <tr>
   <td>Pievienot failu: </td>
   <td>
     <input type="file" name="file">
  </td>
 </tr>
 <tr>
   <td> </td>
   <td><input type="submit" name="Submit" value="Pievienot"></td>
 </tr>
</table> </form>

Link to comment
Share on other sites

×
×
  • Create New...