fixed signbook

This commit is contained in:
Bizcochito 2022-05-14 22:30:31 +02:00
parent 49b008966b
commit 6cb1beb8d2
1 changed files with 20 additions and 27 deletions

View File

@ -9,37 +9,30 @@
<body id="index">
<?php
// define variables and set to empty values
$name = $email = $capcha = $comment = $website = $nameErr = $hosting = $capchaErr = "";
$name = $email = $comment = $website = $nameErr = $hosting = $capchaErr = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($_POST["capcha"] !== "I love me") {
$capchaErr = "You stupid fucking dingus";}
else{
if (empty($_POST["name"])) {
$nameErr = "Name is required";
} else {
$name = "\"".test_input($_POST["name"])."\"";
}
$email = "\"".test_input($_POST["email"])."\"";
$website = "\"".test_input($_POST["website"])."\"";
$comment = "\"".test_input($_POST["comment"])."\"";
if ($_POST["capcha"] !== "I love me") {
$capchaErr = "You stupid fucking dingus";
} else {
$capcha = test_input($_POST["capcha"]);
}
if(strpos($_SERVER["HTTP_HOST"], ".onion")){
$hosting = "tor!";
}
elseif(strpos($_SERVER["HTTP_HOST"], ".i2p")){
$hosting = "i2p!";
}
elseif(strpos($_SERVER["HTTP_HOST"], ".fai")){
$hosting = "fai!";
}
if(strpos($_SERVER["HTTP_HOST"], ".onion")){ $hosting = "tor!";}
elseif(strpos($_SERVER["HTTP_HOST"], ".i2p")){ $hosting = "i2p!";}
elseif(strpos($_SERVER["HTTP_HOST"], ".fai")){ $hosting = "fai!";}
else{$hosting = "???!";}
$myfile = fopen("signs.csv", "a") or die("Unable to open file!");
$txt = $name.",".$website.",".$email.",".$comment.",".date("Y-m-d").",".$hosting."\n";
fwrite($myfile, $txt);
fclose($myfile);
}
}
}
function test_input($data) {
$data = trim($data);