-
Notifications
You must be signed in to change notification settings - Fork 0
/
inputCheckBox.php
65 lines (47 loc) · 1.87 KB
/
inputCheckBox.php
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
<?php
$txtNombre = "";
$rdgLenguaje = "";
$chkphp = "";
$chkpython = "";
$chkjs = "";
if($_POST){
$txtNombre = (isset($_POST["txtNombre"])) ? $_POST["txtNombre"]: "" ;
$rdgLenguaje = (isset($_POST["lenguaje"])) ? $_POST["lenguaje"]: "" ;
$chkphp = isset($_POST["chkphp"]) ? "checked" : "";
$chkpython = isset($_POST["chkpython"]) ? "checked" : "";
$chkjs = isset($_POST["chkjs"]) ? "checked" : "";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Formulario inputTextt</title>
</head>
<body>
<?php if($_POST){?>
<strong>Hola</strong>: <?php echo $txtNombre;?>
<strong>Lenguaje Favorito</strong>: <?php echo $rdgLenguaje;?>
<?php }?>
<form action="inputCheckBox.php" method="post">
Nombre:
<br/>
<input type="text" name="txtNombre" id="" value=<?php echo $txtNombre; ?>>
<br/>
<br/>
¿Te gusta?:<br/>
<br/>php:<input type="radio" <?php echo ($rdgLenguaje=="php") ? "checked": ""?> name="lenguaje" id="" value="php"><br/>
<br/>python:<input type="radio" <?php echo ($rdgLenguaje=="python") ? "checked": ""?> name="lenguaje" id="" value="python"><br/>
<br/>js:<input type="radio" <?php echo ($rdgLenguaje=="js") ? "checked": ""?> name="lenguaje" id="" value="js"><br/>
<br/>
Estás aprendiendo....<br/>
<br/>php:<input type="checkbox" name="chkphp" id="" value="si" <?php echo $chkphp ?>>
<br/>python:<input type="checkbox" name="chkpython" id="" value="si" <?php echo $chkpython ?>>
<br/>js:<input type="checkbox" name="chkjs" id="" value="si" <?php echo $chkjs ?>>
<br/>
<input type="submit" value="Enviar informacion">
</form>
</body>
</html>