Server IP : 108.170.25.35 / Your IP : 18.222.67.8 Web Server : Apache/2 System : Linux gains.winzonesoftech.com 4.18.0-513.24.1.el8_9.x86_64 #1 SMP Mon Apr 8 11:23:13 EDT 2024 x86_64 User : studio ( 1434) PHP Version : 8.1.28 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/studio/domains/studio7eleven.com/public_html/gfgdfgdfg/ |
Upload File : |
<?php include'header.php';?> <?php include'sidebar.php';?> <?php include 'conn.php';?> <script> function show_confirm() { return confirm("Are You Sure delete"); } </script> <?php $sql=mysqli_query($conn,"SELECT * FROM banner"); $row=mysqli_fetch_array($sql); $checkrows=mysqli_num_rows($sql); if(isset($_POST['submit'])) { $title=$_POST['title']; $description=$_POST['description']; $update="img/".$_FILES['image']['name']; if (move_uploaded_file($_FILES['image']['tmp_name'], $update)) if($checkrows=='0') { $sql=mysqli_query($conn,"INSERT INTO banner(image) VALUES('$update')"); } else{ if($_FILES['image']['tmp_name']!=""){ $id=$row["id"]; $sql=mysqli_query($conn,"UPDATE banner SET image='$update' WHERE id='$id'"); } else{ $sql=mysqli_query($conn,"UPDATE banner SET image='$update' WHERE id='$id'"); } } if($sql) { echo "<script>alert('Data submitted successfully')</script>"; } else{ echo "<script>alert('Failed to submit data')</script>"; } } ?> <!--********************************** Content body start ***********************************--> <div class="content-body recent-imgheight"> <div class="container-fluid"> <div class="row page-titles mx-0"> <div class="col-sm-6 p-md-0"> <div class="welcome-text"> <h4>Studio 7 Eleven Popup Banner</h4> <br> <h5 class="ml-1">Images</h5> </div> </div> </div> <!-- row --> <div class="row"> <div class="col-xl-6 col-xxl-12"> <div class="card"> <div class="card-header"> <h4 class="card-title">Image Upload</h4> </div> <div class="card-body"> <div class="basic-form custom_file_input"> <form action="" method="POST" enctype="multipart/form-data"> <div class="form-group"> <div class="custom-file"> <input type="file" name="image" class="custom-file-input"> <label class="custom-file-label">Choose file</label> </div> <br> <br> <div class="col-12"> <button type="submit" value="UPLOAD" name="submit"class="btn btn-primary mb-2">Submit</button> </div> </div> </form> </div> </div> </div> </div> </div> </div> </div> <!--********************************** Content body end ***********************************--> <!--********************************** Content body start ***********************************--> <div class="content-body"> <div class="container-fluid"> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-header"> <h4 class="card-title">Popup Banner</h4> </div> <div class="card-body"> <div class="table-responsive"> <table id="example" class="display" style="min-width: 845px"> <thead> <tr> <th>S.NO</th> <th>Image</th> </tr> </thead> <tbody> <?php $x=1; $display=mysqli_query($conn,"SELECT * From banner"); while ($row=mysqli_fetch_array($display)) { ?> <tr> <td><?php echo $x;?></td> <td><img height="100px" src="<?php echo $row['image'];?>" alt="image"></td> </tr> <?php $x++; } ?> </tbody> <tfoot> <tr> <th>S.NO</th> <th>Image</th> </tr> </tfoot> </table> </div> </div> </div> </div> </div> </div> </div> <!--********************************** Content body end ***********************************--> <?php include'footer.php';?>