File manager - Edit - /home/custbahd/scorisinternationaljunior.com/admin/gallery/add.php
Back
<?php session_start(); include_once('../db/connection.php'); if(isset($_POST['submit'])){ if($_POST['access'] != 'scoris256'){ $access = $_POST['access']; $_SESSION['error'] = "Incorrect access code, get code from admin!"; //return the inputted fields $_SESSION['access'] = $_POST['access']; } else { $title = $_POST['title']; $image = $_FILES['image']['name']; $target = "images/".basename($_FILES['image']['name']); $sql = "INSERT INTO gallery (title, image, target) VALUES ('$title', '$image', '$target')"; if (move_uploaded_file($_FILES['image']['tmp_name'], $target)); //use for MySQLi OOP if($conn->query($sql)){ $_SESSION['success'] = 'Image succesfully saved to gallery.'; } /////////////// //use for MySQLi Procedural // if(mysqli_query($conn, $sql)){ // $_SESSION['success'] = 'Member added successfully'; // } ////////////// else{ $_SESSION['error'] = 'Something went wrong while adding the image to gallery!'; } } } header('location: ./'); ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 1.5 |
proxy
|
phpinfo
|
Settings