D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
vedios
/
Filename :
insert_video.php
back
Copy
<?php include "../config.php"; error_reporting(E_ALL); ini_set('display_errors', 0); // Disable displaying errors in the browser ini_set('log_errors', 1); ini_set('error_log', 'error.log'); // Specify the log file path // Retrieve data from the form error_log("Before database connection", 0); // Database connection code error_log("After database connection", 0); // ... other parts of your script // ... (Database connection code) if ($_SERVER['REQUEST_METHOD'] === 'POST') { $title = $_POST['title']; $description = $_POST['description']; $youtube_link = $_POST['youtube_link']; $category_id = $_POST['category_id']; $upload_date = $_POST['upload_date']; $sql = "INSERT INTO videos (title, description, youtube_link, upload_date) VALUES ('Video Title', 'Video Description', 'YouTube Link', 'Upload Date'); $stmt = $conn->prepare($sql); $stmt->bind_param("sssis", $title, $description, $youtube_link, $category_id, $upload_date); if ($stmt->execute()) { echo "Video added successfully!"; } else { echo "Error: " . $conn->error; } $stmt->close(); } // Close the database connection $conn->close(); ?>