-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.php
38 lines (32 loc) · 1.04 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<title>Discord.txt</title>
<?php error_reporting(0); ?>
<form method="POST">
<input type="text" name="prezdivka" placeholder="Jméno:" value="<?php echo $_COOKIE['prezdivka']; ?>"><br>
<textarea cols="100" rows="10" placeholder="Příspěvek:" name="text" required></textarea><br>
<button type="submit" value="Odeslat" name="submit">Odeslat</button>
</form>
<?php
$cas = Time();
$file = "discord.txt";
if(empty(trim($_POST['text']))){
$text = "Zadejte prosím nějaký text.";
} else{
$text_error = trim($_POST['text']);
}
if (empty($kontrola))
if (isset($_POST['submit']))
{
$username = $_POST['prezdivka'];
setcookie('prezdivka', $username, time() + (86400 * 30 * 999), "/");
$fo = fopen($file, "a");
if (fwrite($fo, '
<br>
<strong>Přezdívka:</strong> '
. htmlspecialchars($_POST['prezdivka']) . '<br>
<strong>Napsal: </strong>'
. $text = htmlspecialchars($_POST['text']) . '
'));
fclose($fo);
}
?>
<?php readfile('discord.txt'); ?>