Server IP : 162.214.80.37 / Your IP : 216.73.216.1 Web Server : Apache System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : imyrqtmy ( 2189) PHP Version : 8.2.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home2/imyrqtmy/public_html/skyispatudyog/sym/Users/0-imyrqtmy/zugadu/AdminPanel/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php include'include/connection.php';?> <!DOCTYPE html> <html> <head> <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css"> <link rel="stylesheet" href="https://sweetalert.js.org/assets/css/app.css"> <script src="https://sweetalert.js.org/assets/sweetalert/sweetalert.min.js"></script> <style type="text/css"> /*.swal-title { font-size: 100px; } .swal-button,.swal-text { font-size: 50px; } .swal-modal { width: 80%; padding:50px; }*/ </style> </head> <body> <?php if(isset($_POST['wind'])) { $path=""; $brand=$_POST['brand']; $model=$_POST['model']; $year=$_POST['year']; $city=$_POST['city']; $title=$_POST['name']; $desc=$_POST['desc']; $ori=$_POST['orip']; $loc=$_POST['locp']; $filename = $_FILES['image1']['name']; $tmp=$_FILES['image1']['tmp_name']; date_default_timezone_set('Asia/Kolkata'); $currentTime = date( 'Ymd-His', time () ); $info = pathinfo($filename); $file_name = basename($filename,'.'.$info['extension']); $ext = pathinfo($filename, PATHINFO_EXTENSION); //Setup our new file path $newFilePath = "./uploads/" .$file_name. $currentTime.".".$ext; $mf=move_uploaded_file($tmp,$path.$newFilePath); $sql="insert into windshield_data(Title,Brand,City,Model,Year,Original,Local,Image,Description) values('$title','$brand','$city','$model','$year','$ori','$loc','$newFilePath','$desc')"; $dfsa=mysqli_query($db,$sql) or die (mysqli_error($db)); if($dfsa) { ?> <script> swal({ title: "Windshield Added!", text: "", type: "success" }).then(function() { window.location = "viewwindshield.php"; }); </script> <?php } else { ?> <script> swal({ title: "Sorry!", text: "Something went wrong! Please try again", type: "error" }).then(function() { window.location = "addwindshield.php"; }); </script> <?php } } ?> </body> </html> <?php if (isset($_POST['submit'])) { $n=$_POST['name']; $p=$_POST['phone']; $e=$_POST['email']; $ins="insert into login_data(Name,PhoneNo,Email) values('$n','$p','$e','$m','$s')"; $que=mysqli_query($db,$ins) or die('error'); if ($que) { ?> <script type="text/javascript">alert("Enquiry sent Successfully !"); </script> <?php echo"<script>location.href='main.php';</script>"; } else { ?> <script type="text/javascript">alert("Something went wrong !");</script> <?php echo"<script>location.href='main.php';</script>"; } } // Compress image function compressImage($source, $destination, $quality) { $info = getimagesize($source); if ($info['mime'] == 'image/jpeg') $image = imagecreatefromjpeg($source); elseif ($info['mime'] == 'image/jpg') $image = imagecreatefromjpg($source); elseif ($info['mime'] == 'image/png') $image = imagecreatefrompng($source); elseif ($info['mime'] == 'video/mp4') $image = imagecreatefrommp4($source); imagejpeg($image, $destination, $quality); } ?>