简体   繁体   English

提交多个段落时出现403错误

[英]403 error when submitting multiple paragraphs

I have a problem with a comment box input. 我在评论框输入中遇到问题。

Everything works very well when only one paragraph is sent, but when multiple 仅发送一个段落,但是发送多个段落时,一切工作都很好

tags are added, i recieve a 403 error. 标签被添加,我收到403错误。 This doesn't happen on the localhost, only on the live website. 这不会在本地主机上发生,只会在实时网站上发生。 The textarea is a rich-text editor using CKeditor. textarea是使用CKeditor的富文本编辑器。 I use the same setup on another page where it does work. 我在其他页面上使用相同的设置。 Can you please help me? 你能帮我么?

This is the form: 形式如下:

<div id="comment-form" class="container">
    <h3>Laat je mening horen!</h3>
    <form class="form-horizontal" role="form" method="POST" action="blog-item.php?blogID='.$blogID.'">
        <div class="form-group">
            <div class="col-sm-6">
                <input type="text" name="auteur" class="form-control" value="'.$_SESSION['username'].'" disabled>
            </div>
        </div>
        <div class="form-group">
             <div class="container col-sm-10">
                 <textarea rows="8" class="form-control" placeholder="Schrijf hier je commentaar" name="commbox" id="commbox"></textarea>
             </div>
        </div>
        <button type="submit" class="btn btn-primary btn-lg">Verstuur</button>
    </form>
</div>

and this is the php that processes the input: 这是处理输入的php:

if ($_SERVER["REQUEST_METHOD"] == "POST"){
    if(empty($_POST["commbox"])){
        echo '<p class="alert alert-danger">Je kan geen leeg comment versturen</p>';
    } else {
        $commbox = htmlspecialchars($_POST['commbox']);
        $auteur = $_SESSION['username'];
        $addCommStmt = $mysqli->prepare("INSERT INTO blogcomments (blogID, comment, auteur) VALUES (?, ?, ?)");
        $addCommStmt->bind_param('sss', $blogID, $commbox, $auteur);
        $addCommStmt->execute();
        $addCommStmt->close();
    }
}

它可能与您的代码无关。它更可能与服务器上的mod_security有关。为了进行测试,请更改尝试提交的整个文本,如果一切正常,则需要请求主机支持将某些mod_security列入白名单。劳斯莱斯。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM