OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
CreateLeadPage
/
process
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:15 AM
rwxr-xr-x
📄
delete_landing_page.php
724 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
save_file.php
1.16 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
save_landing_page.php
2.13 KB
05/19/2025 10:07:15 AM
rw-r--r--
Editing: save_file.php
Close
<?php // process/save_file.php header('Content-Type: application/json'); $response = array('success' => false, 'message' => ''); try { // Get the JSON data $jsonData = file_get_contents('php://input'); $data = json_decode($jsonData, true); if (!isset($data['content']) || !isset($data['filename'])) { throw new Exception('Missing required data'); } // Validate filename if (!preg_match('/^[0-9]+\-[a-z0-9\-]+\.html$/', $data['filename'])) { throw new Exception('Invalid filename format'); } // Set the directory path $directory = '../pages/'; // Create directory if it doesn't exist if (!file_exists($directory)) { mkdir($directory, 0755, true); } // Full file path $filepath = $directory . $data['filename']; // Save the file if (file_put_contents($filepath, $data['content']) === false) { throw new Exception('Failed to save file'); } $response['success'] = true; $response['message'] = 'File saved successfully'; } catch (Exception $e) { $response['message'] = $e->getMessage(); } echo json_encode($response);