Skip to content

Instantly share code, notes, and snippets.

@BMU-Verlag
Created July 30, 2019 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BMU-Verlag/d3b95c5653011e8f005c00b02697c927 to your computer and use it in GitHub Desktop.
Save BMU-Verlag/d3b95c5653011e8f005c00b02697c927 to your computer and use it in GitHub Desktop.
<table width="400" border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
<td>
<strong>
<a href="viewgaestebuch.php">G&auml;stebuch ansehen</a>
<a href="gastebuch.htm">G&auml;stebuch unterschreiben</a>
</strong>
</td>
</tr>
</table>
<br>
<?php
$username = "gb";
$password = "gb";
$database = "gastebuch";
$mysqli = new mysqli("localhost", $username, $password, $database);
$field1 = $mysqli->real_escape_string($_POST['gbName']);
$field2 = $mysqli->real_escape_string($_POST['gbEmail']);
$field3 = $mysqli->real_escape_string($_POST['gbEintrag']);
$query = "INSERT INTO guestbook (name, email, comment )VALUES ('{$field1}','{$field2}','{$field3}')";
$mysqli->query($query);
$mysqli->close();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment