Sourcecode for and sibling adresses.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
3.0 KiB

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>THE GUESTBOOK</title>
<link href="style.css" rel="stylesheet">
<link href="icon.png" rel="icon">
<body id="index">
// define variables and set to empty values
$name = $email = $comment = $website = $nameErr = $hosting = $capchaErr = "";
if ($_POST["capcha"] !== "I love me") {
$capchaErr = "You stupid fucking dingus";}
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);
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
<div class="centercubepleaseind">
<h1>Cool signers:</h1>
<p style="text-align: left;">
$csv = 'signs.csv';
$signers = [];
$f = fopen($csv, 'r');
if ($f === false) { die('Cannot open the file ' . $csv); }
// read each line in CSV file at a time
while (($row = fgetcsv($f)) !== false) { $signers[] = $row; }
foreach($signers as $datasing){
echo $datasing[5]."* At <span style=\"font-weight: bold;\">".$datasing[4]."</span> <a href=\"".$datasing[1]."\">".$datasing[0]."</a> said: <span style=\"font-weight: bold;\">".$datasing[3]."</span>.";
if($datasing[2]){echo " Pester on: <a href=\"mailto:".$datasing[2]."\">".$datasing[2]."</a>";}
echo "<br>";
} ?>
<div class="centerade">
<h2>Be part of this cool babes!</h2>
<form style="text-align: center;" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
Name: <input type="text" name="name"><span style="color: red;" class="error">* <?php echo $nameErr;?></span>
Website: <input type="text" name="website">
E-mail: <input type="text" name="email"><br>
Comment: <textarea name="comment" rows="1" cols="100"></textarea><br>
Capcha(Say me that you love "me"): <input type="text" name="capcha"><span style="color: red;" class="error">* <?php echo $capchaErr;?></span><br>
<input type="submit">