mirror of
http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/darknet-lantern.git
synced 2025-05-16 12:16:57 +00:00
100 lines
3.9 KiB
PHP
100 lines
3.9 KiB
PHP
<?php
|
|
session_start();
|
|
if (isset($_POST['submit'])){
|
|
// Link checks
|
|
$link = str_replace(['<','>'],'', $_POST['link']);
|
|
// Clear user input
|
|
$link = htmlspecialchars($link);
|
|
$name = htmlspecialchars($_POST['name']);
|
|
$description = htmlspecialchars($_POST['description']);
|
|
$sensitive = htmlspecialchars($_POST['sensitive']);
|
|
$category = htmlspecialchars($_POST['category']);
|
|
$captcha = htmlspecialchars($_POST['captcha']);
|
|
// Captcha Auth check
|
|
if ($captcha != htmlspecialchars($_SESSION['secure'])){
|
|
echo "Captcha Failed";
|
|
}else{
|
|
if (empty($link) or empty($name) or empty($description)){
|
|
echo "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{
|
|
|
|
// 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];
|
|
|
|
// 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";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
<!DOCTYPE html>
|
|
<head>
|
|
<title>Darknet Lantern</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<meta name="twitter:card" content="summary" />
|
|
<meta name="description" content="Darknet Lantern is a minimalistic Peer to Peer Decentralised Search Engine for the Darknet, that got officially released on>
|
|
<meta property="og:site_name" content="Darknet Lantern" />
|
|
<meta property="og:title" content="Darknet Lantern" />
|
|
<meta property="og:type" content="website" />
|
|
<!-- // Now displays the url of the instance -->
|
|
<meta property="og:url" content="<?php echo htmlspecialchars($_SERVER['SERVER_NAME']); ?>" />
|
|
<!-- // Default images for previews -->
|
|
<meta property="og:image:url" content="<?php echo htmlspecialchars($_SERVER['SERVER_NAME']) . "/img/logo-large.png"; ?>" />
|
|
<meta property="og:locale" content="en_US" />
|
|
<!-- // This tells search engines which URL should be considered the original source when multiple URLs contain the same content. -->
|
|
<link rel="canonical" href="<?php echo htmlspecialchars($_SERVER['SERVER_NAME']); ?>" />
|
|
<link rel="stylesheet" type="text/css" href="style.css">
|
|
<link rel="icon" href="/img/logo-favicon.png">
|
|
</head>
|
|
<html>
|
|
<?php include("header.php");?>
|
|
<div class="width-class">
|
|
<center>
|
|
<h1>Character Limits</h1>
|
|
<p>Link should be 354</p>
|
|
<p>Name should be 64</p>
|
|
<p>Description should be 256</p>
|
|
<p>Category should be 64</p>
|
|
<p>Sensitive should be 1</p>
|
|
</center>
|
|
<form action="submit.php" method="POST">
|
|
<label style="color:white">Link</label>
|
|
<input required class="input-class" type="text" name="link" placeholder="http://newonionlink.onion/index.html">
|
|
<label style="color:white">Name</label>
|
|
<input required class="input-class" type="text" name="name">
|
|
<label style="color:white">Description</label>
|
|
<input required class="input-class" type="text" name="description">
|
|
<label style="color:white">Category</label>
|
|
<input required class="input-class" type="text" name="category">
|
|
<label style="color:white">Sensitive</label>
|
|
<input required class="input-class" type="text" name="sensitive" placeholder="y/n">
|
|
<label style="color:white">Captcha</label>
|
|
<div>
|
|
<img src="generate.php">
|
|
<input type="text" name="captcha">
|
|
<input type="submit" value="submit" name="submit" />
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</br>
|
|
<center><p><a href="index.php">Previous Page</a></p></center>
|
|
</html>
|