-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinputtype.php
More file actions
31 lines (31 loc) · 925 Bytes
/
inputtype.php
File metadata and controls
31 lines (31 loc) · 925 Bytes
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
<?php
echo '<h1>Verschiedene Eingabetypen</h1>';
echo '<form method="post">
1. Text <input type="text" name="Text" value="'; if(isset($_POST['Text'])){
echo $_POST['Text'];
}
echo '"><br>
2. Radio Button
<input type="radio" name="Geschlecht" value="weiblich"';
if(isset($_POST['Geschlecht'])&&$_POST['Geschlecht']=='weiblich'){
echo ' checked';
}
echo'><input type="radio" name="Geschlecht" value="männlich"';
if(isset($_POST['Geschlecht'])&&$_POST['Geschlecht']=='männlich'){
echo 'checked';
}
echo '><br><input type="submit" name="Abschicken" value="Abschicken"></form>';
if(isset($_POST['Abschicken'])){
echo 'Sie haben ';
echo '1. Typ Text>>';
if(isset($_POST['Text'])){
echo $_POST['Text'];
}
echo '<< eingegeben <br>';
echo '2. Typ Radio Button>>';
if(isset($_POST['Geschlecht'])){
echo $_POST['Geschlecht'];
}
echo '<< eingegeben<br>';
}
?>