2

I have a website that is used core php to build this site. In admin panel when I update a page and insert a image in ckeditor text editor. I am getting error. content is not updated. The error is:

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.

Now what I have to do. Here is my code:

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
            }
        }               
}  
justcurious
  • 839
  • 3
  • 12
  • 29

1 Answers1

0

Maybe this will help:

For Apache 2.4 and in all *.conf files (e.g. httpd-vhosts.conf, http.conf, httpd-autoindex.conf ..etc) use

Require all granted

instead of

Order allow,deny
Allow from all

The Order and Allow directives are deprecated in Apache 2.4.

refer to Error with .htaccess and mod_rewrite

Community
  • 1
  • 1
Puya Sarmidani
  • 1,226
  • 9
  • 26