View sourcecode

The following files exists in this folder. Click to view.

m03u01.php

67 lines UTF-8 Unix (LF)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67


<!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>