当我更新页面时,我收到错误

时间:2015-10-20 09:18:55

标签: php mysql ckeditor

我有一个网站,使用核心php来构建这个网站。在管理面板中,我更新页面并在ckeditor文本编辑器中插入图像。我收到了错误。内容未更新。错误是:

Forbidden. You don't have permission to access /admin/ on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

现在我要做什么。这是我的代码:

if($_REQUEST['page'] == "ac" && isset($_REQUEST['update'])  && $_REQUEST['edit'] == "yes")
{
    $id= $_REQUEST['id'];
    $activitySUB = $_POST['activitySUB'];
    $activityDetels= mysql_escape_string(stripcslashes($_POST['activityDetels']));
    $v = htmlentities($activityDetels); 
    $files = $_FILES['photo']['name'];

    $delete = mysql_query("SELECT activityImages FROM activity WHERE activityID = '$id'");
    $delet = mysql_fetch_array($delete);
    $img = $delet['activityImages'];

    if($files !="")
        {
            $delete = mysql_query("SELECT activityImages FROM activity WHERE activityID = '$id'");
            $delet = mysql_fetch_array($delete);
            $img = $delet['activityImages'];
            if (file_exists("activity/images/upload/$img"))
            {
                unlink("activity/images/upload/$img");
            }

        if($files !="")
        {
            if ((($_FILES["photo"]["type"] == "image/gif")
                            || ($_FILES["photo"]["type"] == "image/jpeg")
                            || ($_FILES["photo"]["type"] == "image/jpg")
                            || ($_FILES["photo"]["type"] == "image/png")
                            || ($_FILES["photo"]["type"] == "image/jpeg"))
                    && ($_FILES["photo"]["size"] < 105000000)) {
                move_uploaded_file($_FILES["photo"]["tmp_name"],"activity/images/upload/$files");
            }
        }

        $UPDATE = mysql_query("update activity set  activitySub = '$activitySUB', activityDetels = '$v', activityImages = '$files' where activityID = '".$_REQUEST['id']."'") or die(mysql_error());
        if($UPDATE)
        {
            ?>
            <script type="text/javascript">
                //window.location ="http://kmahasnat.com/admin/?page=ac&id=<?php echo $id;?>&edit=yes&msg=Content Updated Successfully!";
            </script>               
            <?php
        }
        }
        else
        {
           $insert = mysql_query("update activity set activitySub ='$activitySUB', activityDetels ='$activityDetels', activityImages ='".$img."' where activityID = '".$_REQUEST['id']."'") or die(mysql_error());
           if($insert)
           {
            ?>
            <script type="text/javascript">
                window.location ="http://kmahasnat.com/admin/?page=ac&msg=Content Updated Successfully!";
            </script>               
            <?php
            }
        }               
}  

1 个答案:

答案 0 :(得分:0)

也许这会有所帮助:

对于Apache 2.4和所有* .conf文件(例如httpd-vhosts.conf,http.conf,httpd-autoindex.conf ..etc)使用

Require all granted

而不是

Order allow,deny
Allow from all

在Apache 2.4中不推荐使用Order和Allow指令。

参考Error with .htaccess and mod_rewrite