-
Notifications
You must be signed in to change notification settings - Fork 4
/
formulario_post.php
52 lines (41 loc) · 1.02 KB
/
formulario_post.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
<!DOCTYPE html>
<html>
<head>
<title>Formulario Teste</title>
</head>
<body>
<?php $action = $_SERVER["PHP_SELF"];
?>
<form method="POST" action="">
<label>Nome</label>
<input type="text" name="nome"></input><br />
<label>Email</label>
<input type="text" name="email"></input><br />
<label>Facebook</label>
<input type="text" name="facebook"></input><br />
<label>Sexo</label>
<label><input type="radio" name="sexo" value="feminino"></input>Feminino</label>
<label><input type="radio" name="sexo" value="masculino"></input>Masculino</label>
<br /><br />
<input type="submit" name="submit" value="Enviar"></input>
<!-- Comentário em HTML -->
</form>
<h3>Os dados enviados foram:</h3>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$nome = $email = $sexo = $face = "";
$nome = $_POST["nome"];
$email = $_POST["email"];
$sexo = $_POST["sexo"];
$face = $_POST["facebook"];
echo $nome;
echo "<br />";
echo $email;
echo "<br />";
echo $face;
echo "<br />";
echo $sexo;
}
?>
</body>
</html>