From 0d99af0c57c2a207b50c861b8b0c8c43a3fc60aa Mon Sep 17 00:00:00 2001 From: richonguzman Date: Fri, 15 Sep 2023 17:56:39 -0300 Subject: [PATCH] test1 --- data/process_form.php | 19 +++++++++++++++++++ data/test1.html | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 data/process_form.php create mode 100644 data/test1.html diff --git a/data/process_form.php b/data/process_form.php new file mode 100644 index 0000000..4351854 --- /dev/null +++ b/data/process_form.php @@ -0,0 +1,19 @@ + $_POST['name'], + 'email' => $_POST['email'] + ]; + + // Convert the data array to JSON format + $json_data = json_encode($data); + + // Specify the path where you want to save the JSON file + $file_path = 'userdata.json'; + + // Save the JSON data to the file + file_put_contents($file_path, $json_data); + + echo "Data saved as JSON successfully."; +} +?> \ No newline at end of file diff --git a/data/test1.html b/data/test1.html new file mode 100644 index 0000000..13db39d --- /dev/null +++ b/data/test1.html @@ -0,0 +1,19 @@ + + + + Save Form Data to JSON + + +

Save Form Data to JSON

+ +
+ +
+ + +
+ + +
+ + \ No newline at end of file