Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* HTML */
- <?php
- $msg=0;
- $msg= $_REQUEST['msg'];
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- </head>
- <body>
- <?php if($msg=="enviado"): ?>
- <h1>Mensagem enviada </h1>
- <?php else: ?>
- <form action="processform.php" method="post">
- <center>
- <fieldset>
- <legend>Informacoes Principais</legend>
- <label for="nome_id">Nome: </label>
- <input type="text" placeholder="Marcello" name="nome" id="nome_id" required>
- </br>
- <label for="site_id">Site: </label>
- <input type="url" placeholder="google.com" name="site" id="site_id" required>
- </br>
- <label for="idade_id">Idade: </label>
- <input type="number" min="12" max="60" step="2" name="idade" id="idade_id" required>
- </br>
- <label for="e-mail_id">Email: </label>
- <input type="email" placeholder="prd@gmail.com" name="e-mail" id="e-mail_id" required>
- </br>
- <label for="numero_id">Numero: </label>
- <input type="text" pattern="[(]{1}[0-9]{2}[)]{1}[0-9]{5}[-]{1}[0-9]{4}" title="(00)91234-5678" placeholder="(31)99954-3342" id="numero_id" required>
- </br>
- <label for="key_id">Chave: </label>
- <input type="number" value="73" readonly id="key_id">
- </br>
- <label for="vouche_id">Vouche: </label>
- <input type="number" value="128859" id="vouche_id" disabled>
- </fieldset>
- <fieldset>
- <legend>Informacoes Opcionais</legend>
- <fieldset>
- <legend>Nacionalidade</legend>
- <input id="br_id" name="nacionality" type="checkbox" value="Brasil"> Brasil
- <input id="al_id" name="nacionality" type="checkbox" value="Alemanha"> Alemanha
- <input id="hu_id" name="nacionality" type="checkbox" value="Hungria" checked> Hungria
- </fieldset>
- <fieldset>
- <legend>Sexo</legend>
- <input id="Ma_id" name="sexo" type="radio" value="Masculino" checked> Masculino
- <br>
- <input id="Fe_id" name="sexo" type="radio" value="Feminino"> Feminino
- </fieldset>
- <fieldset>
- <legend>Cor Preferida</legend>
- <input id="Pr_id" name="cor" type="radio" value="Preta" checked> Preta
- <br>
- <input id="Br_id" name="cor" type="radio" value="Branca"> Branca
- </fieldset>
- </br>
- <datalist id="comidas_id">
- <option value="Lasanha">
- <option value="Lambo">
- <option value="Lampada">
- <option value="Amparina">
- </datalist>
- <label for="comida_id">Comida: </label>
- <input id = "comida_id" name = "comida" type = "text" list = "comidas_id">
- </fieldset>
- <br>
- <select id = "estados_id" name = "estado" multiple = "multiple">
- <optgroup label = "Regiao Sudeste">
- <option value = "SP"> Sao Paulo </option>
- <option value = "RJ"> Rio de Janeiro </option>
- <option value = "RS"> Rio Grande do Sul </option>
- </optgroup>
- <optgroup label = "Regiao Nordeste ">
- <option value = "PR"> Parana </option>
- <option value = "RN"> Rio Grande do Norte </option>
- <option value = "BA"> Bahia </option>
- </optgroup>
- </select >
- </br> </br>
- <input id="botao_sub" type="submit" value="enviar">
- <input id="botao_res" type="reset" value="resetar">
- </center>
- </form>
- <?php endif; ?>
- </body>
- </html>
- /* PHP */
- <?php
- $nome = $_POST['nome'];
- $site = $_POST['site'];
- $idade = $_POST['idade'];
- $email = $_REQUEST['e-mail']; // REQUEST recebe tanto via GET quanto POST
- echo "Bem vindo $nome seus dados:".</br>;
- echo "$site $idade $email".</br>;
- $dest = "prodmarcello@gmail.com";
- $assu = "Formulario";
- $corp = "My message $idade";
- $head = "Content-type: text/html; charset= utf-8\n";
- $head .= "From: $dest Reply-to: $email";
- mail($dest, $assu, $corp, $head);
- header("location:form.html?msg=enviado");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement