-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselect-multiple.php
More file actions
40 lines (39 loc) · 1 KB
/
Copy pathselect-multiple.php
File metadata and controls
40 lines (39 loc) · 1 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
<!DOCTYPE html>
<?php
$lazeresc=isset($_POST['selLazer'])?$_POST['selLazer']:array();
$lazer=array('Informática','Música','Basquete','Tenis','Volei');
?>
<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="select.php">Exemplo Select</a></li>
<li><a href="check-box.php">Exemplo Checkbox</a></li>
<li><a href="text.php">Exemplo Text</a></li>
<li><a href="radio.php">Exemplo Radio</a></li>
</ul>
</div>
<form class="" action="" method="post">
<label>Lazer</label><br>
<select name="selLazer[]" id="selLazer[]" multiple="multiple" size="6">
<option value=""> </option>
<?php
for ($i=0; $i < count($lazer); $i++) {
if(in_array($lazer[$i],$lazeresc))
echo "<option value='$lazer[$i]' selected>$lazer[$i]</option>";
else
echo "<option value='$lazer[$i]'>$lazer[$i]</option>";
}
?>
</select>
<input type="submit" value="send">
</form>
<?php
?>
</body>
</html>