Escape texts before writing to database.
This commit is contained in:
@@ -24,8 +24,8 @@ if (!isset($_POST['Speichern'])) {
|
||||
<?php
|
||||
} else {
|
||||
if ('' != $_FILES['Foto']['name']) {
|
||||
$Autor = $_POST['Autor'];
|
||||
$Text = $_POST['Text'];
|
||||
$Autor = $db->real_escape_string($_POST['Autor']);
|
||||
$Text = $db->real_escape_string($_POST['Text']);
|
||||
$Datum = $_POST['Datum'];
|
||||
$sql1 = 'INSERT INTO gb (ID, Autor, Text, Datum) VALUES (NULL, "' . $Autor . '", "' . $Text . '", "' . $Datum . '");';
|
||||
$stmt1 = $db->prepare($sql1);
|
||||
|
||||
Reference in New Issue
Block a user