fixed signbook
This commit is contained in:
parent
49b008966b
commit
6cb1beb8d2
45
book.php
45
book.php
|
@ -9,36 +9,29 @@
|
|||
<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 (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"]);
|
||||
$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(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);
|
||||
}
|
||||
}
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue