Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $name = $_POST['nick'];
- $comment = $_POST['comm'];
- $text = <<<END
- <article>
- <h4>$name</h4>
- <h3>$comment</h3>
- </article>
- END;
- echo <<<END
- <html>
- <body>
- <form method="post" action="index.php" enctype="multipart/form-data">
- Name <input name="nick" type="text">
- Comment <input name="comm" type="text">
- <input type="submit">
- </form>
- </body>
- </html>
- END;
- if($file = fopen("index.php", 'r+')){
- fwrite($file,$text);
- fclose($file);
- }else echo 'cannot open file';
- ?>
Add Comment
Please, Sign In to add comment