From 3a68ba0febb1beaee35e84c8f0cfb447b0042bd1 Mon Sep 17 00:00:00 2001 From: Devdatt Bhatt Date: Wed, 20 May 2026 11:53:01 +0000 Subject: [PATCH] update --- encoder/app.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/encoder/app.php b/encoder/app.php index 6e77b00..f8975f3 100644 --- a/encoder/app.php +++ b/encoder/app.php @@ -8,13 +8,13 @@ License text: https://github.com/shreebhatt_ji/Urmi/blob/main/licence.md */ -include 'header.php'; - $json_file = '/var/www/html/app.json'; +$error_message = ''; -// --- 1. Handle Form Submission at the very beginning --- +// --- 1. Handle Form Submission BEFORE any HTML is sent --- if (isset($_POST['submit'])) { $upload_paths = [ + 'app_und' => '/var/www/html/app_ad.png', // Note: I noticed a potential mismatch in your logic, but keeping your structure 'app_ad' => '/var/www/html/app_ad.png', 'app_logo' => '/var/www/html/app_logo.png' ]; @@ -60,7 +60,6 @@ if (isset($_POST['submit'])) { header("Location: " . $_SERVER['PHP_SELF']); exit; } else { - // If there are errors, we continue to the display part so the user can see them $error_message = implode("
", $errors); } } @@ -76,6 +75,9 @@ function getValue($data, $key) { return $data[$key] ?? ''; } + +// Now we can safely start sending HTML +include 'header.php'; ?>
@@ -83,7 +85,7 @@ function getValue($data, $key)

Company Information Entry

- +