Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( !empty( $_GET["id"] ) ) {
- $idUsuario = $_GET["id"];
- $idName = $_GET["name"];
- echo $idUsuario;
- echo $idName;
- }
- if ( !empty( $_POST["nome"] ) ) {
- $nome = $_POST["nome"];
- echo $nome;
- }
- ?>
- <html>
- <head>
- <title>POST & GET</title>
- </head>
- <body>
- <h1>POST & GET</h1>
- <a href="index.php?id=5&name=Andre"> Link para GET </a>
- <br><br>
- <form action="index.php" method="POST">
- <div>
- <label for="nome">Nome:</label>
- <input type="text" name="nome" />
- </div>
- <div>
- <label for="email">E-mail:</label>
- <input type="email" id="email" />
- </div>
- <div>
- <label for="msg">Mensagem:</label>
- <textarea id="msg"></textarea>
- </div>
- <div class="button">
- <button type="submit">Enviar sua mensagem</button>
- </div>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement