mirror of
http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/darknet-lantern.git
synced 2025-07-01 20:16:41 +00:00
submit message status
This commit is contained in:
parent
3cb5af0f36
commit
0cf9966611
1 changed files with 7 additions and 7 deletions
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
session_start();
|
||||
$submission_message = null; // Initialize the variable
|
||||
|
||||
$status_class = null;
|
||||
if (isset($_POST['submit'])){
|
||||
// Link checks
|
||||
$link = str_replace(['<','>'],'', $_POST['link']);
|
||||
|
@ -14,13 +14,13 @@ if (isset($_POST['submit'])){
|
|||
$captcha = htmlspecialchars($_POST['captcha']);
|
||||
// Captcha Auth check
|
||||
if ($captcha != htmlspecialchars($_SESSION['secure'])){
|
||||
$submission_message = "<h3 class='submission-status-error'>Captcha Failed</h3>";
|
||||
$submission_message = "Error: Captcha Failed";
|
||||
} else {
|
||||
if (empty($link) or empty($name) or empty($description)){
|
||||
$submission_message = "<h3 class='submission-status-error'>All of the fields must not be empty</h3>";
|
||||
$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){
|
||||
$submission_message = "<h3 class='submission-status-error'>Don't exceed the limit</h3>";
|
||||
$submission_message = "Error: Don't exceed the limit";
|
||||
} else {
|
||||
|
||||
// Open the file once before the loop
|
||||
|
@ -41,7 +41,7 @@ if (isset($_POST['submit'])){
|
|||
}
|
||||
|
||||
if ($submission_message === null) { // Only set success message if no error occurred
|
||||
$submission_message = "<h3 class='submission-status-success'>Link Successfully Submitted</h3>";
|
||||
$submission_message = "Link Successfully Submitted";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ if (isset($_POST['submit'])){
|
|||
<html>
|
||||
<?php include("header.php");?>
|
||||
<div class="width-class">
|
||||
<?php echo $submission_message; ?>
|
||||
<h3 class="<?php echo str_contains($submission_message, 'Error') ? 'submission-status-error' : 'submission-status-success' ?>"> <?php echo $submission_message ?> </h3>
|
||||
<center>
|
||||
<h1>Character Limits</h1>
|
||||
<p>Link should be 354</p>
|
||||
|
@ -96,7 +96,7 @@ if (isset($_POST['submit'])){
|
|||
<label style="color:white">Captcha</label>
|
||||
<div>
|
||||
<img src="generate.php">
|
||||
<input type="text" name="captcha">
|
||||
<input required type="text" name="captcha">
|
||||
<input type="submit" value="submit" name="submit" />
|
||||
</div>
|
||||
</form>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue