fork download
  1. <?php
  2.  
  3. // your code goes here
  4. if ('POST' == $_SERVER['REQUEST_METHOD']) {
  5. print "HELLO, " . $_POST['name'];
  6. } else {
  7. print<<<_HTML_
  8. <form action="$_SERVER[PHP_SELF] method = "post">
  9. Your name: <input type="text" name = "name">
  10. <input type="submit" value = "SAY HELLO">
  11. </form>
  12. _HTML_;
  13. }
Success #stdin #stdout #stderr 0.01s 82880KB
stdin
Standard input is empty
stdout
    <form action="prog.php method = "post">
        Your name: <input type="text" name = "name">
        <input type="submit" value = "SAY HELLO">
    </form>
stderr
PHP Notice:  Undefined index: REQUEST_METHOD in /home/Gk6fG7/prog.php on line 4