1
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<link rel="stylesheet" href="layout.css" type="text/css">
</head>
<body>
<form action="register.php" method="post">
<p>Name:</p>
<input type="text" name="name">
<p>Nachname:</p>
<input type="text" name="nname">
<p>Benutzername:</p>
<input type="text" name="uname">
<p>Telefonnummer:</p>
<input type="tel" name="tel">
<p>E-Mail:</p>
<input type="email" name="email">
<p>Passwort:</p>
<input type="password" name="pass">
<p>Passwort Wiederhohlen:</p>
<input type="password">
<br>
<button type="submit">Account erstellen</button>
</form>
<?php
$db_host = 'localhost';
$db_user = 'root';
$db_pass = '';
$db_database = 'account_data';
/* End config */
$myConnection = mysqli_connect("$db_host","$db_user","$db_pass") or die ("could not connect to mysql");
mysqli_select_db($myConnection, "account_data") or die ("no database");
$name = $_POST["name"];
$nname = $_POST["nname"];
$uname = $_POST["uname"];
$tel = $_POST["tel"];
$email = $_POST["email"];
$pass = $_POST["pass"];
echo $name;
echo $nname;
echo $uname;
echo $tel;
echo $email;
echo $pass;
if($name == "" or $nname ="" or $uname ="" or $tel ="" or $email ="" or $pass ="" ){
echo "Du musst die mit * Makierten Felder ausfüllen!";
}else{
$eintrag = "INSERT INTO account_data
(Name, Nachname, Benutzername, Telefonnummer, Email, Passwort)
VALUES
('$name', '$nname', '$uname', '$tel', '$email', '$pass')";
$eintragen = mysqli_query($myConnection, $eintrag);
}
?>
</body>
</html>
[Edit Jörg; Codeblock eingefügt]