Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title></title>
- <!-- Aqui dentro do head insiro o código da biblioteca jquery -->
- <script src="https://code.jquery.com/jquery-1.12.4.js"
- integrity="sha256-Qw82+bXyGq6MydymqBxNPYTaUXXq7c8v3CwiYwLLNXU="
- crossorigin="anonymous">
- </script>
- <!-- Script de confirmação de envio -->
- <script language="JavaScript">
- function pergunta(){
- if (confirm('Tem certeza que quer enviar este formulário?')){
- document.seuformulario.submit()
- }
- }
- </script>
- </head>
- <body>
- <form action="index.php" method="post" enctype="text/plain">
- <label>Nome: <input type="text" name="nome" id="nome"></label><br>
- <label>Idade: <input type="text" name="Idade" id="idade"></label><br>
- <input type="submit" name="submit" onclick="pergunta()" id="submit">
- </form>
- <?php
- if(isset($_POST['submit'])){
- if(isset($_POST['nome'])){
- $nome = $_POST['nome'];
- }
- if(isset($_POST['idade'])){
- $nome = $_POST['idade'];
- }
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment