Html 是否重定向到页面中的特定div?

Html 是否重定向到页面中的特定div?,html,Html,我有以下代码: <body> <div id="cp_container"> <a href="#" onclick="show_questions_panel()" >Questions</a> <a href="#" onclick="show_profile_panel()" >Profile </a> <div id="cp_questions_panel"> <div id="cp_b

我有以下代码:

<body>
<div id="cp_container">
<a href="#" onclick="show_questions_panel()" >Questions</a>
<a href="#" onclick="show_profile_panel()" >Profile </a>

<div id="cp_questions_panel">

    <div id="cp_button_container">
        <a href="#" onclick="show_all_questions()" >All Questions </a>
        <br>
        <a href="#" onclick="show_un_answered_questions()" >  Un Answered Questions</a>

    </div>

    <div id="cp_all_questions">

    </div>

    <div id="cp_un_answered_questions">
        <div id='question_edit_form'>

            <form  method="post" action="cpanel.php#cp_un_answered_questions">

                <label>Question Title </label><br>
                <input type="text" name="question_title_edit" id='question_title_edit'>
                <br>
                <label>Question</label><br>
                <textarea name="question_edit" id="question_edit" rows="5" cols="50"></textarea>
                <br>
                <label>Answer Title </label><br>
                <input type="text" name="answer_title_edit" id="answer_title_edit">
                <br>
                <label>Answer</label><br>
                <textarea name="answer_edit" id="answer_edit" rows="5" cols="50"></textarea>
                <br>

                <input type="input" name="question_id_edit" id="question_id_edit">
                <input type="submit" value="Save">

            </form>

        </div> <!--End of  question_edit_form-->

    </div> <!-- End Of cp_un_answered_questions -->

</div> <!-- End Of cp_questions_panel -->

<div id="cp_profile_panel">

</div>


问题标题

问题

答案标题

回答

在上述代码中,存在此行:

<form  method="post" action="cpanel.php#cp_un_answered_questions">


但表单提交后,浏览器会转到“cpanel.php”页面。我希望浏览器转到提交的表单以报告提交的结果。很想解决它吗?

你能触摸一下cpanl.php代码吗?如果是这样,您可以通过重定向添加哈希值。无论如何,POST请求应该通过重定向来处理,以防止通过刷新页面而意外地重新发布。我的POST中的代码存在于cpanel.php上。什么是散列值以及如何使用它?我正在网上搜索哈希值。