Guest User

Untitled

a guest
Jul 31st, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2. $name = $_POST['nick'];
  3. $comment = $_POST['comm'];
  4. $text = <<<END
  5. <article>
  6. <h4>$name</h4>
  7. <h3>$comment</h3>
  8. </article>
  9. END;
  10.  
  11. echo <<<END
  12. <html>
  13. <body>
  14. <form method="post" action="index.php" enctype="multipart/form-data">
  15. Name <input name="nick" type="text">
  16. Comment <input name="comm" type="text">
  17. <input type="submit">
  18. </form>
  19. </body>
  20. </html>
  21. END;
  22.  
  23. if($file = fopen("index.php", 'r+')){
  24. fwrite($file,$text);
  25. fclose($file);
  26. }else echo 'cannot open file';
  27. ?>
Add Comment
Please, Sign In to add comment