Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <body>
- <form action="/" method="POST">
- Post Comment: <br>
- <input type="text" style="width: 300px;" name="comment">
- <input type="submit">
- </form>
- <br>
- <?php
- if(isset($_POST["comment"]))
- {
- $comment = $_POST["comment"];
- if(file_exists("comments.txt"))
- {
- $comments = file_get_contents("comments.txt");
- $comments = $comments . $comment;
- file_put_contents("comments.txt", $comments);
- echo file_get_contents("comments.txt");
- }
- else
- {
- file_put_contents("comments.txt", $comment);
- echo file_get_contents("comments.txt");
- }
- }
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment