The following files exists in this folder. Click to view.
m03u01.php67 lines UTF-8 Unix (LF) 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
<!doctype html>
<html lang="sv">
<head>
<meta charset="utf-8">
</head>
<body>
<?php
if (isset($_POST['first_name'])){
$firstName = $_POST['first_name'];
$surname = $_POST['surname'];
$email = $_POST['email'];
$adress = $_POST['adress'];
$telefon = $_POST["phone"];
$birthday = $_POST['birthday'];
$gender = $_POST['gender'];
$userCondition = isset($_POST['user_condition'])? "Ja" : "Nej";
echo "<h2>Din registrering</h2>";
echo"<p><strong>Namn:</strong> $firstName $surname </p>";
echo"<p><strong>E-post:</strong> $email </p>";
echo"<p><strong>Telefon:</strong> $telefon </p>";
echo"<p><strong>Adress:</strong> $adress </p>";
echo"<p><strong>Födelsedatum:</strong> $birthday </p>";
echo"<p><strong>Kön:</strong> $gender </p>";
echo"<p><strong>Godkännande av villkor:</strong> $userCondition </p>";
} else {
?>
<h2>Registeringsformulär</h2>
<form action="" method="POST">
<label>Förnamn: <input type="text" name="first_name" required> </label><br><br>
<label>Efternamn: <input type="text" name="surname" required> </label><br><br>
<label>E-post: <input type="email" name="email" required> </label><br><br>
<label>Telefon: <input type="text" name="phone" required> </label><br><br>
<label>Adress: <input type="text" name="adress" required> </label><br><br>
<label>Födelsedatum: <input type="date" name="birthday" required> </label><br><br>
<label>Kön:</label><br>
<label> <input type="radio" name="gender" value="Kvinna"> Kvinna</label> <br>
<label> <input type="radio" name="gender" value="Man"> Man</label> <br><br>
<label><input type="checkbox" name="user_condition">Jag godkänner användarvillkoren</label><br><br>
<input type="submit" value="registrera">
</form>
<?php
}
?>
</body>
</html>