mirror of
http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/darknet-lantern.git
synced 2025-05-17 04:36:57 +00:00
changes
This commit is contained in:
parent
ca5290d94b
commit
029cd458ee
5 changed files with 113 additions and 20 deletions
59
www/search.php
Normal file
59
www/search.php
Normal file
|
@ -0,0 +1,59 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<body>
|
||||
<head>
|
||||
<title>Darknet Onion Webring</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
</head>
|
||||
|
||||
|
||||
<center>
|
||||
|
||||
<?php
|
||||
require("header.php");
|
||||
?>
|
||||
|
||||
<form action="search.php" method="GET">
|
||||
<input type="text" name="query" />
|
||||
<input type="submit" value="Search" />
|
||||
</form>
|
||||
|
||||
|
||||
<?php
|
||||
$query = $_GET['query'];
|
||||
// gets value sent over search form
|
||||
|
||||
$min_length = 3;
|
||||
$max_length = 32;
|
||||
if(strlen($query) >= $min_length and strlen($query) <= $max_length){ // if query length is more or equal minimum length then
|
||||
|
||||
$query = htmlspecialchars($query);
|
||||
// removes the risky characters
|
||||
// there needs to be regex checking, only allow [a-zA-Z0-9.:/]
|
||||
$query=preg_replace("/[^a-zA-Z0-9:\/.\ ]/", "", $query);
|
||||
|
||||
echo "Search results for " . $query . " :";
|
||||
echo nl2br("\n");
|
||||
echo "<p>" . "Instance name: " . $_SERVER['SERVER_NAME'] . "</p>";
|
||||
$instance= $_SERVER['SERVER_NAME'];
|
||||
echo nl2br("\n");
|
||||
$verifiedcsvpath="participants/" . $instance . '/verified.csv';
|
||||
$unverifiedcsvpath="participants/" . $instance . '/unverified.csv';
|
||||
//echo $verifiedcsvpath;
|
||||
//echo nl2br("\n");
|
||||
//echo $unverifiedcsvpath;
|
||||
echo nl2br("\n");
|
||||
DisplayCSVNEW($unverifiedcsvpath);
|
||||
// display the results of verified.csv
|
||||
// only display the results of verified.csv that matches with the search term
|
||||
// display the results of unverified.csv
|
||||
// only display the results of unverified.csv that matches with the search term
|
||||
|
||||
}
|
||||
else{ // if query length is less than minimum or more than maximum
|
||||
echo "Error: Query must be between ".$min_length . " and ".$max_length . " characters.";
|
||||
}
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue