From d6c7b2d5b503a22e6165ae212edcdade08785671 Mon Sep 17 00:00:00 2001 From: "@jehovahsays" Date: Mon, 17 Jun 2024 14:15:36 -0400 Subject: [PATCH] if file exists added to action.php --- action.php | 409 ++++++++++++++++++++++++++++------------------------- 1 file changed, 214 insertions(+), 195 deletions(-) diff --git a/action.php b/action.php index 2ddd8c0..55d8225 100644 --- a/action.php +++ b/action.php @@ -24,202 +24,220 @@ if ($answer1 == "Human") { $totalCorrect++; } echo "
$totalCorrect / 1 correct
"; foreach($_POST as $variable => $value) { - $value = str_replace(' ', '_', $value); + $value = str_replace(' ', '_', $value); + // checking whether file exists or not + + $file_pointer = './en/' . $value . '.html'; + + + + if (file_exists($file_pointer)) + { + + echo "The file $file_pointer exists"; + } + + else + { + + + + $handle = fopen("./en/" . $value . ".html", "a"); fwrite($handle, - "\n" -. "" -. "" -. $value -. "" -. "" -. "" -. "" -. "