Prikazi cijelu temu 30.05.2020 22:10
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Lokacija:Tuzla


Predmet:Re: csv u bazu
PreuzmiIzvorni kôd (PHP):
  1. <?php
  2. $target_dir = "uploads/";
  3.  
  4. if(isset($_POST['submit']))
  5. {
  6.           $file_name = $_FILES['fileUpload']['name'];
  7.       $file_tmp = $_FILES['fileUpload']['tmp_name'];
  8. $check =  move_uploaded_file($file_tmp,"uploads/".$file_name);
  9.   if($check !== false) {
  10.     echo "uspjelo";
  11.  
  12.   } else {
  13.     echo "nije uspjelo";
  14.   }    
  15. }
  16. ?>
  17. <form method="post" enctype="multipart/form-data">
  18.         <table class="buttons width-25">
  19.                 <tr>
  20.                         <td>
  21.                                 <p>1. Tehnicar racunarstva</p>
  22.                                 <!-- <a href="http://www.google.com">Link1 goes here</a> -->
  23.                         </td>
  24.                         <td>
  25.                                
  26.                         <td>
  27.                                 <input type="file" name="fileUpload" id="fileUpload">
  28.                                 <label class="buttons custom" for="file-upload">IZABERI FILE</label>
  29.                                
  30.                                 <!-- <a href="http://www.google.com">Link2<br>goes<br>here</a> -->
  31.                         </td>
  32.                         <td>
  33.  
  34.                                         <!--<button type="submit" class="buttons submit" name="submit" value="submit">UPLOAD</button>-->
  35.  
  36.                                 <!-- <a href="http://www.google.com">Link3<br>goes<br>here</a> -->
  37.                         </td>
  38.                         <!--
  39.                         <td>
  40.                                 <a href="http://www.google.com">Link4<br>goes<br>here</a>
  41.                         </td>
  42.                         -->
  43.                 </tr>
  44.                 <tr>
  45.                         <td>
  46.                                 <p>2. Tehnicar elektronike</p>
  47.                                 <!-- <a href="http://www.google.com">Link1 goes here</a> -->
  48.                         </td>
  49.                         <td>
  50.                                
  51.                         <td>
  52.                                 <input id="file-upload" type="file" />
  53.                                 <label class="buttons custom" for="file-upload">IZABERI FILE</label>
  54.                                
  55.                                 <!-- <a href="http://www.google.com">Link2<br>goes<br>here</a> -->
  56.                         </td>
  57.                         <td>
  58.  
  59.                                         <!--<button type="submit" class="buttons submit" name="submit" value="submit">UPLOAD</button>-->
  60.  
  61.                                 <!-- <a href="http://www.google.com">Link3<br>goes<br>here</a> -->
  62.                         </td>
  63.                         <!--
  64.                         <td>
  65.                                 <a href="http://www.google.com">Link4<br>goes<br>here</a>
  66.                         </td>
  67.                         -->
  68.                 </tr>
  69.                 <tr>
  70.                         <td>
  71.                                 <p>3. Tehnicarelektro-energetike</p>
  72.                                 <!-- <a href="http://www.google.com">Link1 goes here</a> -->
  73.                         </td>
  74.                         <td>
  75.                        
  76.                         <td>
  77.                                 <input id="file-upload" type="file" />
  78.                                 <label class="buttons custom" for="file-upload">IZABERI FILE</label>
  79.                                
  80.                                 <!-- <a href="http://www.google.com">Link2<br>goes<br>here</a> -->
  81.                         </td>
  82.                         <td>
  83.                                         <!--<button type="submit" class="buttons submit" name="submit" value="submit">UPLOAD</button>-->
  84.                                 <!-- <a href="http://www.google.com">Link3<br>goes<br>here</a> -->
  85.                         </td>
  86.                         <!--
  87.                         <td>
  88.                                 <a href="http://www.google.com">Link4<br>goes<br>here</a>
  89.                         </td>
  90.                         -->
  91.                 </tr>
  92.                 <tr>
  93.                         <td>
  94.                                 <p>4. Tehnicar mehatronike</p>
  95.                                 <!-- <a href="http://www.google.com">Link1 goes here</a> -->
  96.                         </td>
  97.                         <td>
  98.                        
  99.                         <td>
  100.                                 <input id="file-upload" type="file" />
  101.                                 <label class="buttons custom" for="file-upload">IZABERI FILE</label>
  102.                                
  103.                                 <!-- <a href="http://www.google.com">Link2<br>goes<br>here</a> -->
  104.                         </td>
  105.                         <td>
  106.                                 <!--    <button type="submit" class="buttons submit" name="submit" value="submit">UPLOAD</button>-->
  107.                                 <!-- <a href="http://www.google.com">Link3<br>goes<br>here</a> -->
  108.                         </td>
  109.                         <!--
  110.                         <td>
  111.                                 <a href="http://www.google.com">Link4<br>goes<br>here</a>
  112.                         </td>
  113.                         -->
  114.                 </tr>
  115.                 <tr>
  116.                         <td>
  117.                                 <p>5. Elektricar </p>
  118.                                 <!-- <a href="http://www.google.com">Link1 goes here</a> -->
  119.                         </td>
  120.                         <td>
  121.                        
  122.                         <td>
  123.                                 <input id="file-upload" type="file" />
  124.                                 <label class="buttons custom" for="file-upload">IZABERI FILE</label>
  125.                                
  126.                                 <!-- <a href="http://www.google.com">Link2<br>goes<br>here</a> -->
  127.                         </td>
  128.                         <td>
  129.                                         <button type="submit" class="buttons submit" name="submit" value="submit">UPLOAD</button>
  130.                                 <!-- <a href="http://www.google.com">Link3<br>goes<br>here</a> -->
  131.                         </td>
  132.                         <!--
  133.                         <td>
  134.                                 <a href="http://www.google.com">Link4<br>goes<br>here</a>
  135.                         </td>
  136.                         -->
  137.                 </tr>
  138.         </table>
  139. </form>

napravio sam samo za prvi file i na zadnji taster.
Podrška samo putem foruma, jer samo tako i ostali imaju koristi od toga.