File manager - Edit - /home/custbahd/scorisinternationaljunior.com/admin/activities/deactive/add.php
Back
<?php session_start(); include_once('../db/connection.php'); if(isset($_POST['add'])){ $title = $_POST['title']; $description = $_POST['description']; $type = $_POST['type']; $teacher = $_POST['teacher']; $start = $_POST['start']; $endd = $_POST['endd']; $day = $_POST['day']; $image = $_FILES['image']['name']; $target = "../images/".basename($_FILES['image']['name']); $sql = "INSERT INTO activities (title, description, type, teacher, start, endd, day, image) VALUES ('$title', '$description', '$type', '$teacher', '$start', '$endd', '$day', '$image')"; if (move_uploaded_file($_FILES['image']['tmp_name'], $target)); //use for MySQLi OOP if($conn->query($sql)){ $_SESSION['success'] = 'Activity added successfully'; } /////////////// //use for MySQLi Procedural // if(mysqli_query($conn, $sql)){ // $_SESSION['success'] = 'Member added successfully'; // } ////////////// else{ $_SESSION['error'] = 'Something went wrong while adding the activity!'; } } header('location: ../'); ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 2 |
proxy
|
phpinfo
|
Settings