Registrierung

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

// Parametervariablen angefordert von der URL

$vorname = isset($_REQUEST["textinput1"]) ? $_REQUEST["textinput1"] : '';


$nachname = isset($_REQUEST["textinput2"]) ? $_REQUEST["textinput2"] : '';
$Geb = isset($_REQUEST["textinput3"]) ? $_REQUEST["textinput3"] : '';
$HNr = isset($_REQUEST["textinput4"]) ? $_REQUEST["textinput4"] : '';
$PLZ = isset($_REQUEST["textinput5"]) ? $_REQUEST["textinput5"] : '';
$Straße = isset($_REQUEST["textinput6"]) ? $_REQUEST["textinput6"] : '';
$searchTerm = isset($_POST["searchinput"]) ? $_POST["searchinput"] : '';

// 1. SQL-Abfrage(n) aus phpMyAdmin


$sql4 = "INSERT INTO Hörer(Vorname, Nachname, Geb, HNr, PLZ, Straße)
VALUES (?, ?, ?, ?, ?, ?);";

// 2. Vorbereiten der DB auf die Abfrage(n)


$NeuHörer = $db->prepare($sql4);

// 3. Ausführen des SQL-Befehls


$NeuHörer->execute([$vorname, $nachname, $Geb, $HNr, $PLZ, $Straße]);

<form class="form-horizontal" method="POST" action="">


<fieldset>
<legend>Registrierung</legend>
<div class="form-group">
<label class="col-md-4 control-label" for="textinput1">Name</label>
<div class="col-md-4">
<input id="textinput1" name="textinput1" type="text"
placeholder="Vorname" class="form-control input-md">
<span class="help-block">help</span>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label"
for="textinput2">Nachname</label>
<div class="col-md-4">
<input id="textinput2" name="textinput2" type="text"
placeholder="Nachname" class="form-control input-md">
<span class="help-block">help</span>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label"
for="textinput3">Geburtstag</label>
<div class="col-md-4">
<input id="textinput3" name="textinput3" type="text"
placeholder="YYYY-MM-DD" class="form-control input-md">
<span class="help-block">YYYY-MM-DD</span>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label" for="textinput4">HNr</label>
<div class="col-md-4">
<input id="textinput4" name="textinput4" type="text"
placeholder="placeholder" class="form-control input-md">
<span class="help-block">help</span>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label" for="textinput5">PLZ</label>
<div class="col-md-4">
<input id="textinput5" name="textinput5" type="text"
placeholder="placeholder" class="form-control input-md">
<span class="help-block">help</span>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label"
for="textinput6">Straße</label>
<div class="col-md-4">
<input id="textinput6" name="textinput6" type="text"
placeholder="placeholder" class="form-control input-md">
<span class="help-block">help</span>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label" for="singlebutton"></label>
<div class="col-md-4">
<button id="singlebutton" name="singlebutton" class="btn btn-
primary">Registrieren</button>
</div>
</div>
</fieldset>
</form>

You might also like