-
Notifications
You must be signed in to change notification settings - Fork 0
/
pratica11.php
46 lines (35 loc) · 1.24 KB
/
pratica11.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title> Prática 11 - Formulário </title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']);?>" method="post">
<label> Nome: </label>
<input type="text" id="nome" name="nome" />
<br/> <br/>
<label> E-mail: </label>
<input type="email" id="mail" name="mail" />
<br/> <br/>
<label> Telefone: </label>
<input type="tel" id="telefone" name="telefone" />
<br/> <br/>
<input type="submit" id="enviar" name="enviar" value="ENVIAR"/>
</form>
<h2> Dados informados: </h2>
<?php
$nome = $email = $telefone = "";
if($_SERVER['REQUEST_METHOD'] == "POST") {
$nome = $_POST['nome'];
$email = $_POST['mail'];
$telefone = $_POST['telefone'];
echo "<strong> Nome: </strong> $nome <br/>";
echo "<strong> E-mail: </strong> $email <br/>";
echo "<strong> Telefone: </strong> $telefone <br/>";
}
?>
</body>
</html>