Server IP : 62.72.28.201 / Your IP : 18.118.193.28 Web Server : LiteSpeed System : Linux in-mum-web1113.main-hosting.eu 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : u249650955 ( 249650955) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : ON Directory (0755) : /home/u249650955/domains/ladyflorencepublicschool.com/public_html/admin_area/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<!DOCTYPE> <?php include("includes/db.php"); ?> <html> <head> <title>Inserting Product</title> <script src="//cdn.ckeditor.com/4.12.1/full/ckeditor.js"></script> </head> <body> <form action="insert_notic.php" method="post" enctype="multipart/form-data"> <table align="center" width="100%" border="2" bgcolor="orange"> <tr align="center"> <td colspan="8"><h2 style="padding:10px;">Insert New Slider Here</h2></td> </tr> <tr> <td align="center"><b>Slider Images :</b></td> <td align="center"><input type="file" name="product_image" required></td> </tr> <tr align="center"> <td colspan="8"><input type="submit" name="insert_post" value="Insert Product" class="btn"></td> </tr> </table> </form> <script> CKEDITOR.replace( 'notic_title' ); </script> <style> td input{ width: 90%; padding: 5px; margin: 5px; border-radius: 20px; } td select{ width: 90%; padding: 5px; margin: 5px; border-radius: 20px; text-align: center; } .img-type{ padding: 5px; border-radius: 10px; } .btn{ width: 30%; cursor: pointer; background: #0009; color: #fff; padding: 10px; } .btn:hover{ background: blue; } .decri{ border-radius: 8px; resize: none; } </style> </body> </html> <?php //getting the text data from the fields if(isset($_POST['insert_post'])){ //getting the image from the field $product_image = $_FILES['product_image']['name']; $product_image_tmp = $_FILES['product_image']['tmp_name']; move_uploaded_file($product_image_tmp,"product_images/$product_image"); $insert_product = "insert into slider_active (s_img) value ('$product_image')"; $insert_pro = mysqli_query($con, $insert_product); if($insert_pro){ echo "<script>alert('Product Has been inserted!')</script>"; echo "<script>window.open('index.php?insert_slider','_self')</script>"; } } ?>