如何制作评论框,最好使用javascript或php,然后显示评论?

I am trying to make a comment box for my website, I can make the background and other items using html and css, but I want people to be able to leave comment, questions, or concerns, to improve the users enjoyment. I have researched many ways of how I could possiblely make a comment box, how to write it out to a file, how to show the comments, and how to update the file, but because I personally don't know PHP or Java Scripting I don't know how to do any of that. I have looked at other peoples coding and have managed to come up with something along the lines of this:

This is for the form (It is in an html):

<div class="commentf">
    <table>
        <tbody>
             <FORM action="submit.html" method="post">
                <tr>
                    <td><LABEL for="name">Name: </LABEL>
                              <INPUT type="text" id="name"></td>
                </tr>
                <tr>
                    <td><LABEL for="email">E-Mail: </LABEL>
                               <INPUT type="text" id="email"></td>
                </tr>
                <tr>
                    <td><LABEL for="subject">Subject: </LABEL>
                              <INPUT type="text" id="subject"></td>
                </tr>
                <tr>
                    <td><LABEL for="comment">Text: </LABEL>
                              <TEXTAREA type="text" id="comment">Comment:</TEXTAREA></td>
                </tr>
                <tr>
                    <td><INPUT type="submit" value="Submit"> <INPUT type="reset"></td>
                </tr>
            </FORM>
        </tbody>
    </table>
</div>

And this is the PHP file (saved as an html, for some reason when I try to open it as a php file it opens a save as box instead of running the php, so I just saved it as a html) that "processes" the information:

<?php
        if(isset($_POST['name']) && isset($_POST['email'] && isset ($_POST['subject'] && isset ($_POST['comment'])))) {
        $data = $_POST['name'] . '-' . $_POST['email'] . '-' . $_POST['subject'] . '-' . $_POST['comment'] . "
";
        $ret = file_put_contents('HAS.txt', $data, FILE_APPEND | LOCK_EX);
        if($ret === false) {
        die('There was an error writing this file');
    }
    else {
        echo "$ret bytes written to file";
    }
}
else {
   die('no post data to process');
}

Lastly, this is part of the html that I first displayed, so that it would show the comments...

<div class="postcomment">
     <FORM>
            <br>Name:</b> <?php echo $_POST['name']; ?> <INPUT type="text" id="name">
            <br>E-Mail:</b> <?php echo $_POST['email']; ?> <INPUT type="text" id="email">
            <br>Subject:</b> <?php echo $_POST['subject']; ?> <INPUT type="text" id="subject">
            <br>Comment:</b> <?php echo $_POST['comment']; ?> <TEXTAREA type="text" id="comment"></TEXTAREA>
     </FORM>
</div>

I know it is a big mess and all... but I'd appreciate it a lot if any one would respond to me with the correct answer. If any one, for whatever reason doesn't understand the question, I'd be more than happy to collaborate with them to better understand the question to progress further into my website.

Thanks!!!

If you haven't found an answer yet heres a simple html way of creating comments section for your website it contains the php

<?php
if ($_POST){

$name = $_POST['name'];
$content = $_POST['commentContent'];
$handle = fopen("comments.html","a");
fwrite ($handle,"<b>" . $name . "</b></br>" . $content . "</br>");
fclose ($handle);}

?>

<html>
<body>

<form action="" method="POST">
Content: <textarea rows ="10" cols ="30" name="commentContent"></textarea></br>
Name: <input type = "text" name = "name"></br>
<input type = "submit" value = "post!"></br>
</form>

<?php include "comments.html"; ?>
</body>
</html>

just create a blank html called comments.html in same folder hope some help if no answer yet

Currently you are using the id of the input, textarea tags to access it values from $_POST. That is not possible. You have to use the name attribute of the tag to access it value from $_POST.

<div class="postcomment">
 <FORM>
        <br>Name:</b> <?php echo $_POST['name']; ?> <INPUT type="text" name="name">
        <br>E-Mail:</b> <?php echo $_POST['email']; ?> <INPUT type="text" name="email">
        <br>Subject:</b> <?php echo $_POST['subject']; ?> <INPUT type="text" name="subject">
        <br>Comment:</b> <?php echo $_POST['comment']; ?> <TEXTAREA type="text" name="comment"></TEXTAREA>
 </FORM>