diff --git a/encoder/app.php b/encoder/app.php index c06e0b7..fd19ee2 100644 --- a/encoder/app.php +++ b/encoder/app.php @@ -11,7 +11,7 @@ https://github.com/shreebhatt_ji/Urmi/blob/main/licence.md $json_file = '/var/www/html/app.json'; $error_message = ''; -// --- 1. Handle Form Submission BEFORE any HTML is +// --- 1. Handle Form Submission BEFORE any HTML is rendered --- if (isset($_POST['submit'])) { $upload_paths = [ 'app_ad' => '/var/www/html/app_ad.png', @@ -30,7 +30,7 @@ if (isset($_POST['submit'])) { unlink($path); // Also remove from encoder directory $secondary_path = $secondary_dir . basename($path); - if (file_exists($secondary_path)) unlink($secondary_path); + if (file_exists($secondary_path)) unlink($payload_path = $secondary_path); } } } @@ -68,7 +68,7 @@ if (isset($_POST['submit'])) { // 6. Resize (Resample) imagecopyresampled( - $dest_img, + $dst_img, $src_img, 0, 0, @@ -82,7 +82,6 @@ if (isset($_POST['submit'])) { // 7. Save to primary destination with compression (level 7) if (imagepng($dst_img, $destination, 7)) { - // FIXED: Changed $int_name to $destination $filename = basename($destination); $secondary_destination = $secondary_dir . $filename; @@ -203,15 +202,15 @@ include 'header.php';

Upload Ad (PNG)

- + - +
New file selected (will upload on save)
Current:
- +
@@ -219,7 +218,7 @@ include 'header.php';
-

Upload Logo (PNG)

+

Upload Logo (PNG)