Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ftp_config['server'] = 'xxx';
- $ftp_config['username'] = 'xxx';
- $ftp_config['password'] = 'xxx';
- $ftp_config['web_root'] = '/public_html/admin/failai';
- $gg=$_GET['fail'];
- echo $gg;
- $fileElementName = $gg;
- // echo $fileElementName;
- $conn_id = ftp_connect($ftp_config['server']);
- $ftp_login = ftp_login($conn_id,$ftp_config['username'],$ftp_config['password']);
- if(!ftp_put($conn_id,$ftp_config['web_root'].'/'.$_FILES[$fileElementName]['name'],$_FILES[$fileElementName]['tmp_name'],FTP_BINARY)){
- $result = " Klaida keliant paveiksleli ";
- }else{
- $result = " Paveikslelis sekmingai įkeltas ";
- }
- echo $result;
- echo $ftp_config['web_root'].'/'.$_FILES[$fileElementName]['name'];
- $db=mysqli_connect('xxx', 'xxx', 'xx','xx') or die ('Neprisijunge');
- $fr=$_GET['pf'];
- $gr=$_GET['tip'] ;
- $ps=$_GET['dt'] ;
- $gp=$_GET['lk'] ;
- $vr=$_GET['at'] ;
- $tb=$_GET['apr'] ;
- $de=$_GET[$_FILES[$fileElementName]['name']] ;
- $uiras="insert into turnyrai (pav,data,laikas,autorius,img,tipas,aprasymas)
- values ('$fr','$ps','$gp','$vr','$de','$gr','$tb')";
- $uirasv=mysqli_query($db,$uiras) or die ("Neirase <br> $uiras");
- if($uirasv)
- echo"<br>Irase".$fr;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement