发布值$ _SERVER ['REQUEST_URI'] 403禁止

时间:2015-11-06 08:26:06

标签: php cpanel http-status-code-403 request-uri

嗨我试图建立我的网站。初始的PHP非常有用。我可以从db中获取选择值。当我点击提交按钮即时

Forbidden

You don't have permission to access / on this server.

错误。提交按钮使用POST $ _SERVER ['REQUEST_URI']并且它与php相同并在tinymce富文本框中添加/更改值作为下面的代码。

<script language="javascript" type="text/javascript">
function initMCEexact(e){   
     tinyMCE.init({
        theme : "advanced",
        mode: "exact",
        elements : e,
        theme_advanced_toolbar_location : "top",
        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,"
        + "justifyleft,justifycenter,justifyright,justifyfull,formatselect,"
        + "bullist,numlist,outdent,indent,preview,print",
        theme_advanced_buttons2 : "link,unlink,anchor,image,separator,"
        +"undo,redo,cleanup,code,separator,sub,sup,charmap",
        theme_advanced_buttons3 : "",

        height:"800px",
        width:"100%",
         plugins: "print,preview",
        toolbar: "print,preview"

    });
}
initMCEexact("elm1");
</script>

<form method="post" action="<?=$_SERVER['REQUEST_URI']?>">
  <textarea id="elm1" name="elm1" rows="15" cols="80" width="100%"><?php echo $sContent;?></textarea>

<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</form>

并发布表格的一面

if(isset($_POST['elm1']) || isset($_POST["btn-upload"])) {
if(isset($_SESSION['sContent'])){
    $sContent=$_SESSION['sContent'];
}  
$sContent = strip_tags(stripslashes($_POST['elm1']),$allowedTags);
if(isset($_SESSION['id']) && isset($_SESSION['name'])){
$sql="INSERT INTO kopru (kopruid, kopruadi, html) VALUES('$kopruid', '$kopruname', '$sContent') ON DUPLICATE KEY UPDATE kopruadi=VALUES(kopruadi), html=VALUES(html)";
    mysqli_query($conn,$sql);
}
if(isset($_SESSION['sContent'])){
    $_SESSION['sContent']=$sContent;
}   

}

它非常适用于本地wamp服务器。

我使用cpanel作为面板。

0 个答案:

没有答案
相关问题