OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
genai
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/17/2025 10:17:24 AM
rwxrwxr-x
📁
assets
-
03/13/2025 04:09:56 AM
rwxr-xr-x
📁
clients
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
deeplit.php
12.18 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
genai.php
38.06 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
genai_article_save.php
1.6 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
genai_function.php
21.48 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
genai_save.php
2.15 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
genai_style.css
3.69 KB
03/11/2025 09:30:56 AM
rw-r--r--
📄
genaicreative.php
20.81 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
index.php
32.24 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
latest_genai.php
45.55 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
process_genai.php
2.15 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
request_article.php
24.17 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
zgenai_function.php
17.26 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
zprocess_genai.php
2.02 KB
05/19/2025 10:07:13 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 if (!isset($_POST['working_headline'])) { $_POST['working_headline'] = "no working headline"; } if (!isset($_POST['generated_content'])) { $_POST['generated_content'] = "no generated content"; } $db = new mysqli($servername, $username, $password, $dbname); if ($db->connect_error) { die("Connection failed: " . $db->connect_error); } mysqli_query($db, "SET NAMES utf8"); mysqli_query($db, "SET time_zone = '+5:30'"); $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>"; function capitalizeWords($input) { // Split the input string into words $words = explode(' ', $input); // Capitalize the first letter of each word except short words (length == 2 or length == 3) foreach ($words as &$word) { $word = ucfirst($word); // Capitalize the word } // Join the words back into a string and return return implode(' ', $words); } $title = capitalizeWords($title); // 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); if (mysqli_stmt_execute($stmt)) { // Successful insertion $response = 'Record saved successfully in your collection!'; } else { // Error inserting record $response = 'Error inserting record: ' . mysqli_stmt_error($stmt); } print_r($response); // Close the statement and connection mysqli_stmt_close($stmt); mysqli_close($db);