fixed signbook
This commit is contained in:
parent
49b008966b
commit
6cb1beb8d2
47
book.php
47
book.php
|
@ -9,36 +9,29 @@
|
||||||
<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 (empty($_POST["name"])) {
|
if ($_POST["capcha"] !== "I love me") {
|
||||||
$nameErr = "Name is required";
|
$capchaErr = "You stupid fucking dingus";}
|
||||||
} else {
|
else{
|
||||||
$name = "\"".test_input($_POST["name"])."\"";
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$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!";
|
|
||||||
}
|
|
||||||
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) {
|
function test_input($data) {
|
||||||
|
|
Loading…
Reference in New Issue