OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
knobly_scribe
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/17/2025 10:17:24 AM
rwxrwxr-x
📄
edit_post.php
2.23 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
getEditContent.php
874 bytes
05/19/2025 10:07:19 AM
rw-r--r--
📄
index.php
28.4 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
process_data.php
5.24 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
scribe.php
53.48 KB
05/19/2025 10:07:19 AM
rw-r--r--
Editing: edit_post.php
Close
<?php header('Content-Type: application/json'); include '../db_config.php'; if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($_POST['action'] == 'edit') { // edit_post.php if (isset($_POST['post_id']) && isset($_POST['content'])) { $post_id = $_POST['post_id']; $new_content = trim($_POST['content']); // Get the current timestamp for 'editedOn' $editedOn = date('Y-m-d H:i:s'); // Get current time // Prepare the SQL statement to update the post content and editedOn timestamp $stmt = $readerdb->prepare("UPDATE reader_scribe SET chat = ?, editedOn = ? WHERE id = ?"); $stmt->bind_param("ssi", $new_content, $editedOn, $post_id); // "ssi" means string, string, integer if ($stmt->execute()) { $response = [ 'status' => 'success', 'message' => 'Post updated successfully.' ]; } else { $response = [ 'status' => 'error', 'message' => 'Error: ' . $stmt->error ]; } $stmt->close(); echo json_encode($response); } } if ($_POST['action'] == 'delete') { // delete_post.php if (isset($_POST['post_id'])) { $post_id = $_POST['post_id']; $deletedOn = date('Y-m-d H:i:s'); // Get current time for deletedOn // Prepare the SQL statement to set the deleteFlag and the deletedOn timestamp $stmt = $readerdb->prepare("UPDATE reader_scribe SET deleteFlag = 1, deletedOn = ? WHERE id = ?"); $stmt->bind_param("si", $deletedOn, $post_id); // "si" means string, integer if ($stmt->execute()) { $response = [ 'status' => 'success', 'message' => 'Post deleted successfully.' ]; } else { $response = [ 'status' => 'error', 'message' => 'Error: ' . $stmt->error ]; } $stmt->close(); echo json_encode($response); } } }