fork download
  1. <?php
  2. header('Content-type: text/html; charset=utf-8');
  3. $login = $_REQUEST['username'];
  4. $pass = $_REQUEST['pass'];
  5. echo "$login $pass $bool";
  6. if (($login == "user1") and ($pass == "123")) {
  7. header('Location: /1.php');
  8. }
  9. ?>
  10. <html>
  11. <head>
  12. <meta charset = "UTF-8" />
  13. </head>
  14. <body>
  15. <form action="index.php" method="post">
  16. login: <input type="text" name="username" /><br />
  17. Pass: <input type="text" name="pass" /><br />
  18. <input type="submit" name="submit" value="Отправь меня!" />
  19. </form>
  20. <?php echo "$bool"; ?>
  21. </body>
  22. </html>
Success #stdin #stdout #stderr 0.01s 20568KB
stdin
Standard input is empty
stdout
  <html>
<head>
<meta charset = "UTF-8" />
</head>
<body>
<form action="index.php" method="post">
    login:  <input type="text" name="username" /><br />
    Pass: <input type="text" name="pass" /><br />
    <input type="submit" name="submit" value="Отправь меня!" />
</form>
</body>
</html>
stderr
PHP Notice:  Undefined index: username in /home/pDyVky/prog.php on line 3
PHP Notice:  Undefined index: pass in /home/pDyVky/prog.php on line 4
PHP Notice:  Undefined variable: bool in /home/pDyVky/prog.php on line 5
PHP Notice:  Undefined variable: bool in /home/pDyVky/prog.php on line 20