diff --git a/www/header.php b/www/header.php index 0073bf1..a168414 100644 --- a/www/header.php +++ b/www/header.php @@ -203,8 +203,6 @@ function DisplayCategories($instancename, $path) { ?> - -

Update Frequency: every 3 hours


diff --git a/www/index.php b/www/index.php index f147029..9e67613 100644 --- a/www/index.php +++ b/www/index.php @@ -23,6 +23,7 @@
CSV LINES: " . $lines_uv . " " . $lines_v . "

"; - ?> +

@@ -99,6 +100,7 @@ require("header.php"); ?>
+
Submit a new link
'],'', $_POST['link']); - // Clear user input + // Clear user input $link = htmlspecialchars($link); $name = htmlspecialchars($_POST['name']); $description = htmlspecialchars($_POST['description']); @@ -12,33 +14,36 @@ if (isset($_POST['submit'])){ $captcha = htmlspecialchars($_POST['captcha']); // Captcha Auth check if ($captcha != htmlspecialchars($_SESSION['secure'])){ - echo "Captcha Failed"; - }else{ + $submission_message = "Error: Captcha Failed"; + } else { if (empty($link) or empty($name) or empty($description)){ - echo "All of the fields must not be empty"; - }else{ + $submission_message = "Error: All of the fields must not be empty"; + } else { if (strlen($link) > 512 or strlen($name) > 64 or strlen($description) > 256 or strlen($sensitive) > 1 or strlen($category) > 64){ - echo "Don't excede the limit"; - }else{ + $submission_message = "Error: Don't exceed the limit"; + } else { - // Open the file once before the loop - $file = fopen("../submissions/submission.csv", "a"); + // Open the file once before the loop + $file = fopen("../submissions/submission.csv", "a"); - if ($file !== false) { - // Create an array with the inputs to write as a single row - $row = [$link, $name,$description,$category,$sensitive]; + if ($file !== false) { + // Create an array with the inputs to write as a single row + $row = [$link, $name,$description,$category,$sensitive]; - // Write the row to the CSV file - fputcsv($file, $row, ',', '"'); + // Write the row to the CSV file + fputcsv($file, $row, ',', '"'); - // Close the file after writing - fclose($file); - } else { - // Handle error opening the file - error_log("Error opening the file."); - } - echo "Link Successfully Submitted"; - } + // Close the file after writing + fclose($file); + } else { + // Handle error opening the file + error_log("Error opening the file."); + } + + if ($submission_message === null) { // Only set success message if no error occurred + $submission_message = "Link Successfully Submitted"; + } + } } } } @@ -68,6 +73,7 @@ if (isset($_POST['submit'])){
+

Character Limits

Link should be 354

@@ -90,7 +96,7 @@ if (isset($_POST['submit'])){
- +