D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
proc
/
thread-self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
admin
/
Filename :
insert_event.php
back
Copy
<?php include "../config.php"; // Get data from the form $event_name = $_POST["event_name"]; $event_nameurdu = $_POST["event_nameurdu"]; $event_date = $_POST["event_date"]; $event_time = $_POST["event_time"]; $countdown = $_POST["countdown"]; $location = $_POST["location"]; // SQL to insert data into the events table $sql = "INSERT INTO events (event_name, event_nameurdu, event_date, event_time, countdown, location) VALUES ('$event_name', '$event_nameurdu', '$event_date', '$event_time', '$countdown', '$location')"; if ($conn->query($sql) === TRUE) { echo "Event inserted successfully!<br><a href='allevents.php'>Go back to home</a>"; } else { echo "Error: " . $sql . "<br>" . $conn->error; } $event_name = strip_tags(htmlspecialchars($_POST['event_name'])); $event_nameurdu = strip_tags(htmlspecialchars($_POST['event_nameurdu'])); $m_event_date = strip_tags(htmlspecialchars($_POST['event_date'])); $message = strip_tags(htmlspecialchars($_POST['message'])); $to = "darseislam@gmail.com"; // Change this email to your // $subject = "$m_subject: $name"; $body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nevent_name: $event_name\n\n\nevent_nameurdu: $event_nameurdu\n\nevent_date: $m_subject\n\nMessage: $message"; $header = "From: $email"; $header .= "Reply-To: $email"; if(!mail($to, $subject, $body, $header)) http_response_code(500); ?>