OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
14-4-25-whatsappBot
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/17/2025 10:17:24 AM
rwxrwxr-x
📄
bac_demoForm.html
2.64 KB
04/10/2025 09:05:27 AM
rw-r--r--
📄
db.php
368 bytes
05/19/2025 10:07:21 AM
rw-r--r--
📄
demoForm.html
8.42 KB
04/11/2025 11:33:16 AM
rw-r--r--
📄
news_pagination.json
35 bytes
04/10/2025 08:14:31 AM
rw-r--r--
📄
posts_pagination.json
52 bytes
04/10/2025 08:14:32 AM
rw-r--r--
📄
saveDemo.php
2.55 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
send_log.txt
93.68 KB
04/14/2025 05:13:05 PM
rwxrwxrwx
📄
service-account-credentials.json
2.34 KB
04/11/2025 09:56:21 AM
rw-r--r--
📄
webhook_post_log.txt
272.88 KB
04/10/2025 08:14:32 AM
rw-r--r--
📄
whatsappAPI.php
36.56 KB
05/19/2025 10:07:21 AM
rwxrwxrwx
📄
whatsapp_messages.log
9.53 KB
04/10/2025 08:14:32 AM
rw-r--r--
Editing: saveDemo.php
Close
<?php $servername = "139.59.38.164"; $username = "root"; $password = "newstart"; $dbname = "cream"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // Enable error reporting ini_set('display_startup_errors', 1); if ($_SERVER['REQUEST_METHOD'] === 'POST') { // Get all form fields $fullname = $_POST['fullname'] ?? ''; $email = $_POST['email'] ?? ''; $mobile = $_POST['mobile'] ?? ''; $date = $_POST['date'] ?? ''; $time = $_POST['time'] ?? ''; $description = $_POST['description'] ?? ''; // Validate that all fields are filled if (empty($fullname) || empty($email) || empty($mobile) || empty($date) || empty($time) || empty($description)) { echo "Error: All fields are required."; exit; } // Validate email format if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { echo "Error: Invalid email format."; exit; } // Basic mobile number validation (adjust based on your requirements) if (!preg_match("/^[0-9]{10}$/", $mobile)) { echo "Error: Mobile number should be 10 digits."; exit; } // Validate and format date $dateObject = DateTime::createFromFormat('Y-m-d', $date); if (!$dateObject) { echo "Error: Invalid date format."; exit; } $formattedDate = $dateObject->format('d-m-Y'); // Get the day of the week in English (e.g., "Monday") $eventDay = $dateObject->format('l'); // Validate and format time $timeObject = DateTime::createFromFormat('H:i', $time); if (!$timeObject) { echo "Error: Invalid time format."; exit; } $eventTime = $timeObject->format('g:i A'); // Insert into database $sql = "INSERT INTO bookdemo (fullname, email, mobile, event_date, event_day, event_time, description) VALUES (?, ?, ?, ?, ?, ?, ?)"; $stmt = $conn->prepare($sql); if ($stmt === false) { echo "Error: " . $conn->error; exit; } $stmt->bind_param("sssssss", $fullname, $email, $mobile, $formattedDate, $eventDay, $eventTime, $description); if ($stmt->execute()) { echo "<script> alert('Success: Event added successfully.'); window.close(); </script>"; } else { echo "Error: " . $stmt->error; } $stmt->close(); $conn->close(); } else { echo "Invalid request."; }