fork download
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Demo Post Method</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. </head>
  7. <body>
  8. <form method="POST">
  9. Username: <input type="text" name="username" value=""/> <br/>
  10. password: <input type="password" name="password" value=""/><br/>
  11. <input type="submit" name="send" value="send"/><br/>
  12. <?php
  13. // Nếu người dùng click vào button Gửi Dữ Liệu
  14. // Vì button đó tên là send nên đó cũng là
  15. // tên của key nằm trong biến $_POST
  16. if (isset($_POST['send'])){
  17. echo 'Username: ' . $_POST['username'];
  18. echo '<br/>';
  19. echo 'Password: ' . $_POST['password'];
  20. }
  21. ?>
  22. </form>
  23. </body>
  24. </html>
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
<!DOCTYPE html>
<html>
    <head>
        <title>Demo Post Method</title>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
        <form method="POST">
            Username: <input type="text" name="username" value=""/> <br/>
            password: <input type="password" name="password" value=""/><br/>
            <input type="submit" name="send" value="send"/><br/>
                    </form>
    </body>
</html>