-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselect.php
More file actions
48 lines (41 loc) · 1.08 KB
/
Copy pathselect.php
File metadata and controls
48 lines (41 loc) · 1.08 KB
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
<!DOCTYPE html>
<?php
// ex de Select
function verifySelection($base, $try) {
if ($base == $try)
return 'selected';
}
$tipo=isset($_POST['selMeses'])?$_POST['selMeses']:'';
$m = array('Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro')
?>
<html lang="pt-BR">
<head>
<meta charset="utf-8">
<title><?php ?></title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div>
<ul>
<li><a href="text.php">Exemplo Text</a></li>
<li><a href="check-box.php">Exemplo Checkbox</a></li>
<li><a href="select-multiple.php">Exemplo Select Multiple</a></li>
<li><a href="radio.php">Exemplo Radio</a></li>
</ul>
</div>
<form class="" action="" method="post">
<label>Exemplo de PHP - Select</label><br><br>
<select class="selMeses" name="selMeses">
<?php
for ($x=0; $x < 12; $x++) {
$y = $x + 1;
$status = verifySelection($tipo,$y);
echo "<option value='$y' $status>$m[$x]</option>";
}
?>
</select>
<br>
<input type="submit" name="manda" value="send">
</form>
</body>
</html>