“提交评论”会重定向到另一个页面

I am about to build a comment section in my website. I made comment box. Posting comment and updating that into database works fine. But the problem is while submitting any comment it navigates me to the first page (in my case it's home page under the HOME tab). It doesn't let user stay at the same page.

main.php:

<!--php code for comment section starts--> 

<?php
    mysql_connect("localhost","root","");
    mysql_select_db("comment_section");
    $name=isset($_POST['name'])? $_POST['name'] : '';
    $comment=isset($_POST['comment'])?$_POST['comment'] : '';
    $submit=isset($_POST['submit'])?$_POST['submit'] : '';

    $dbLink = mysql_connect("localhost","root","");
    mysql_query("SET character_set_client=utf8", $dbLink);
    mysql_query("SET character_set_connection=utf8", $dbLink);

    if($submit) {
        if($name&&$comment) {
            $insert=mysql_query("INSERT INTO comment (name,comment) VALUES ('$name','$comment') ");
        } else {
            echo "please fill out all fields";
        }
    }
?>

<!--php code for comment section ends--> 
<!--building a comment section starts-->

<center>
    <form action="" method="POST">
        <table>
            <tr><td>Name: <br><input type="text" name="name"/></td></tr>
            <tr><td colspan="2">Comment: </td></tr>
            <tr><td colspan="5"><textarea name="comment" rows="10" cols="50"></textarea></td></tr>
            <tr><td colspan="2"><input type="submit" name="submit" value="Comment"></td></tr>
        </table>
    </form>

<!--building a comment section ends-->
<!--building a comment section's functionality starts-->
<?php
    {
        $dbLink = mysql_connect("localhost","root","");
        mysql_query("SET character_set_results=utf8", $dbLink);
        mb_language('uni');
        mb_internal_encoding('UTF-8');

        $getquery=mysql_query("SELECT * FROM comment ORDER BY id DESC");
        while($rows=mysql_fetch_assoc($getquery)) {
            $id=$rows['id'];
            $name=$rows['name'];
            $comment=$rows['comment'];

            echo $name.'<br />'.'<br />'.$comment .'<br/>'.'<br/>'.'<hr size="1"/>';
        }    
    }    
?>
<!--building a comment section's functionality ends-->

Try putting <form action="main.php" method="POST"> instead of <form action="" method="POST">. Also, your code is vulnerable to SQL injection. See this StackOverflow discussion to see what I mean and how to prevent it.

Is this comments box is on home page or at any left , right panel.

If it is try to put 'the file path' into < form action 'Give ur file name' > And put ur comment insertion code into that page . Means a page where u want to stay user.

if($submit)
{
  if($name!='' && $comment!='')
  {
   $insert=mysql_query("INSERT INTO comment (name,comment) VALUES ('$name','$comment') ");
   header("location:your filename.php");
   exit;
  }
}