OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
CreateLeadPage_back
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/17/2025 10:17:24 AM
rwxrwxr-x
📄
24-02-25index.php
42.37 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
28index.php
55.04 KB
05/19/2025 10:07:19 AM
rw-r--r--
📁
NW_images
-
02/28/2025 12:23:08 PM
rwxr-xr-x
📄
aditya_index.php
39.95 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
aditya_load_template.php
2.39 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
aditya_save-template.php
2.44 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
aditya_upload.php
851 bytes
05/19/2025 10:07:19 AM
rw-r--r--
📁
assets
-
03/13/2025 08:45:46 AM
rwxr-xr-x
📄
back_index.php
28.33 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
backup_index.php
25.17 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
db_gallery.php
292 bytes
05/19/2025 10:07:19 AM
rw-r--r--
📄
edit_template.php
658 bytes
05/19/2025 10:07:19 AM
rw-r--r--
📄
fetch_data.php
773 bytes
05/19/2025 10:07:19 AM
rw-r--r--
📄
fetch_titles.php
0 bytes
05/19/2025 10:07:19 AM
rw-r--r--
📄
form.js
7.64 KB
03/13/2025 08:45:38 AM
rw-r--r--
📁
images12
-
03/01/2025 05:00:09 AM
rwxr-xr-x
📁
images13
-
03/01/2025 05:00:09 AM
rwxr-xr-x
📁
images14
-
03/01/2025 05:00:10 AM
rwxr-xr-x
📁
images15
-
03/01/2025 05:00:10 AM
rwxr-xr-x
📁
images16
-
03/01/2025 05:00:11 AM
rwxr-xr-x
📁
images17
-
03/01/2025 05:00:11 AM
rwxr-xr-x
📁
images18
-
03/01/2025 05:00:11 AM
rwxr-xr-x
📁
images19
-
03/01/2025 05:00:12 AM
rwxr-xr-x
📁
images2
-
03/01/2025 05:00:12 AM
rwxr-xr-x
📁
images20
-
03/01/2025 05:00:13 AM
rwxr-xr-x
📁
images21
-
03/01/2025 05:00:13 AM
rwxr-xr-x
📁
images3
-
03/01/2025 05:00:14 AM
rwxr-xr-x
📁
images4
-
03/01/2025 05:00:14 AM
rwxr-xr-x
📁
images5
-
03/01/2025 05:00:15 AM
rwxr-xr-x
📁
images6
-
03/01/2025 05:00:15 AM
rwxr-xr-x
📁
images7
-
03/01/2025 05:00:16 AM
rwxr-xr-x
📁
images8
-
03/01/2025 05:00:16 AM
rwxr-xr-x
📁
images9
-
03/01/2025 05:00:17 AM
rwxr-xr-x
📄
index.php
9.53 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
load_template.php
2.21 KB
05/19/2025 10:07:19 AM
rw-r--r--
📁
newsletter
-
03/13/2025 05:29:35 AM
rwxr-xr-x
📄
newsletter.png
194.94 KB
03/13/2025 08:45:38 AM
rw-r--r--
📄
nleditor_navbar.php
22.6 KB
05/19/2025 10:07:19 AM
rw-r--r--
📁
pages
-
03/13/2025 05:29:39 AM
rwxr-xr-x
📁
pages_backup
-
03/13/2025 08:45:51 AM
rwxr-xr-x
📄
process.js
27.81 KB
03/13/2025 08:45:38 AM
rw-r--r--
📄
processb.js
31.21 KB
03/13/2025 08:45:38 AM
rw-r--r--
📄
save-template.php
2.5 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
script.js
34.02 KB
03/13/2025 08:45:38 AM
rw-r--r--
📄
styles.css
2.43 KB
03/13/2025 08:45:38 AM
rw-r--r--
📄
template1.jpg
0 bytes
03/13/2025 08:45:38 AM
rw-r--r--
📄
test.html
5.84 KB
03/13/2025 08:45:38 AM
rw-r--r--
📄
test.php
1.58 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
test_index.php
48.82 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
texts.txt
1.7 KB
03/13/2025 08:45:38 AM
rw-r--r--
📄
upload.php
858 bytes
05/19/2025 10:07:19 AM
rw-r--r--
📁
uploads
-
03/13/2025 08:45:46 AM
rwxr-xr-x
Editing: aditya_save-template.php
Close
<?php // save-template.php header('Content-Type: application/json'); try { // Check if uploads directory exists, if not create it $uploadsDir = __DIR__ . './NW_images/'; if (!file_exists($uploadsDir)) { mkdir($uploadsDir, 0777, true); } // Get the template content and filename $templateContent = $_POST['template']; $templateFileName = $_POST['templateFileName']; // Define the new path in uploads directory $newTemplatePath = $uploadsDir . $templateFileName; // Process images first $imageUpdates = []; foreach ($_FILES as $key => $file) { if (strpos($key, 'image_') === 0) { // Get the image index $imageIndex = str_replace('image_', '', $key); $selector = $_POST["image_{$imageIndex}_selector"]; // Generate unique filename for the image $imageInfo = pathinfo($file['name']); $fileName = uniqid() . '.' . $imageInfo['extension']; $imagePath = $uploadsDir . $fileName; // Move uploaded file if (move_uploaded_file($file['tmp_name'], $imagePath)) { // Store the selector and new path for later replacement $imageUpdates[] = [ 'selector' => $selector, 'newPath' => './NW_images/' . $fileName // Relative path for web access ]; } else { throw new Exception("Failed to upload image: " . $file['name']); } } } // Update image paths in template content foreach ($imageUpdates as $update) { $pattern = '/' . preg_quote($update['selector'], '/') . '\s+src="[^"]*"/'; $replacement = $update['selector'] . ' src="' . $update['newPath'] . '"'; $templateContent = preg_replace($pattern, $replacement, $templateContent); } // Save the template file if (file_put_contents($newTemplatePath, $templateContent) === false) { throw new Exception("Failed to save template file"); } // Return success response with saved paths echo json_encode([ 'success' => true, 'templatePath' => './NW_images/' . $templateFileName, 'message' => 'Template and images saved successfully' ]); } catch (Exception $e) { http_response_code(500); echo json_encode([ 'success' => false, 'error' => $e->getMessage() ]); }