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