OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
genai_backup
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/22/2024 04:05:28 AM
rwxr-xr-x
📄
dashboard.php
5.95 KB
06/22/2024 04:21:20 AM
rw-r--r--
📄
genai_save.php
1.4 KB
06/22/2024 04:21:20 AM
rw-r--r--
Editing: genai_save.php
Close
<?php // Start or resume the session session_start(); include '../inc/validate.logged.php'; include '../inc/config.php'; // Corrected the path $user_id = $gUserId; // Assuming user_id comes from a form $title = mysqli_real_escape_string($db, $_POST['working_headline']); $description = mysqli_real_escape_string($db, $_POST['generated_content']); $date_added = date("Y:m:d H:i:s"); // Use current date and time echo $user_id . "<br>"; echo $title . "<br>"; echo $description . "<br>"; echo $date_added . "<br>"; // Set utf8mb4 character set for MySQL connection mysqli_set_charset($db, "utf8mb4"); // Prepare the SQL statement with placeholders $sql = "INSERT INTO user_collection (user_id, title, description, date_added) VALUES (?, ?, ?, ?)"; // Prepare the statement $stmt = mysqli_prepare($db, $sql); if (!$stmt) { die("Error preparing statement: " . mysqli_error($db)); } // Bind values to the prepared statement mysqli_stmt_bind_param($stmt, "ssss", $user_id, $title, $description, $date_added); // Execute the statement if (mysqli_stmt_execute($stmt)) { echo "<script>alert('Record inserted successfully!'); window.location.href='gen2.php';</script>"; } else { echo "<script>alert('Error inserting record: " . mysqli_stmt_error($stmt) . "'); window.location.href='error.php';</script>"; // Change error.php to your error page } // Close the statement and connection mysqli_stmt_close($stmt); mysqli_close($db); ?>