Advertisement
Zajkiss

ikelims

Dec 8th, 2016
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.46 KB | None | 0 0
  1. <?php
  2.     $ftp_config['server'] = 'xxx';
  3.     $ftp_config['username'] = 'xxx';
  4.     $ftp_config['password'] = 'xxx';
  5.     $ftp_config['web_root'] = '/public_html/admin/failai';
  6.    
  7.            $gg=$_GET['fail'];
  8.            echo $gg;                      
  9.            
  10.  
  11.     $fileElementName = $gg;
  12.    
  13.  //      echo $fileElementName;
  14.     $conn_id = ftp_connect($ftp_config['server']);  
  15.     $ftp_login = ftp_login($conn_id,$ftp_config['username'],$ftp_config['password']);  
  16.  
  17.     if(!ftp_put($conn_id,$ftp_config['web_root'].'/'.$_FILES[$fileElementName]['name'],$_FILES[$fileElementName]['tmp_name'],FTP_BINARY)){  
  18.         $result = " Klaida keliant paveiksleli ";  
  19.     }else{  
  20.         $result = " Paveikslelis sekmingai įkeltas ";  
  21.     }  
  22.     echo $result;
  23.     echo  $ftp_config['web_root'].'/'.$_FILES[$fileElementName]['name'];
  24.  
  25.      
  26.      
  27.      
  28.      
  29.      
  30.      
  31.      
  32.   $db=mysqli_connect('xxx', 'xxx', 'xx','xx') or die ('Neprisijunge');
  33.  
  34.  
  35.  
  36.    $fr=$_GET['pf'];
  37.    $gr=$_GET['tip']  ;
  38.    $ps=$_GET['dt']  ;
  39.     $gp=$_GET['lk']  ;
  40.       $vr=$_GET['at']  ;
  41.          $tb=$_GET['apr']  ;
  42.               $de=$_GET[$_FILES[$fileElementName]['name']]  ;
  43.          $uiras="insert into turnyrai (pav,data,laikas,autorius,img,tipas,aprasymas)
  44.   values ('$fr','$ps','$gp','$vr','$de','$gr','$tb')";
  45.       $uirasv=mysqli_query($db,$uiras) or die ("Neirase <br> $uiras");
  46.       if($uirasv)
  47.       echo"<br>Irase".$fr;
  48.                
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement