Jump to content

Forbidden You don't have permission to access


Stavros

Recommended Posts

Hello, couldn't get the search function going, but need some help on a php file in my application. There is one file that will not process, I have tried a few resolutions from google but nothing seems to work. I have tried changing the file permissions and recopying the entire app onto my host again. I dont understand why it is effecting just one page? Any advise appreciated.

 

File does simple session check and checkbox update to table.

 

Other php files update same table fine with same credentials

Link to comment
Share on other sites

What is the exact error message you are receiving and when does it occur.

 

-You talk about file permissions, but then you imply that this is a mysql issue (update table).  File system permissions have nothing to do with mysql permissions.

Link to comment
Share on other sites

 

Hello I should mention this is from a hosting service (cpanel). The error is

 

Forbidden

 

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

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

**This only occurs on this page** Is there something in the page that could be causing this?

Link to comment
Share on other sites

 

Hello I should mention this is from a hosting service (cpanel). The error is

 

I don't know what you mean by this.  CPanel is just a web administration system. 

 

It does seem to indicate that there is a permissions issue with the script. 

 

 

 

 

Link to comment
Share on other sites

Ok appears I'm on the wrong track. I guess I was highlighting that I have not setup a WAMP here (not sure if that is related to the issue).

 

I'm hitting a brick wall here, I have tried recreating the file still nothing, Is ist something in the file that is performing a task that the server is not happy with? Other PHP seems fine just this one file out of 30?

 

Here is my code:

 

<?php

// Connects to your Database

include("../connect.php");

?>

 

#form_container

{

background:#fff;

 

margin:0 auto;

text-align:left;

width:1020px;

}

</style>

 

</head>

<body id="main_body" >

>

<?php

// Connects to your Database

include("../connect.php");

 

// find out how many records there are to update

$size = count($_REQUEST['element_20']);

 

 

// start a loop in order to update each record

$i = 0;

while ($i < $size) {

 

// define each variable

$element_20= $_REQUEST['element_20'][$i];

$element_21_1= $_REQUEST['element_21_1'][$i];

$element_21_2= $_REQUEST['element_21_2'][$i];

$element_21_3= $_REQUEST['element_21_3'][$i];

$element_21_4= $_REQUEST['element_21_4'][$i];

$element_8_1= $_REQUEST['element_8_1'][$i];

$element_8_1_2= $_REQUEST['element_8_1_2'][$i];

$ID = $_REQUEST['ID'][$i];

 

$query = "UPDATE #SET element_20='$element_20', element_21_1='$element_21_1', element_21_2='$element_21_2',

element_21_3='$element_21_3', element_21_4='$element_21_4', element_8_1='$element_8_1', element_8_1_2='$element_8_1_2' WHERE `ID` = '$ID' LIMIT 1";

mysql_query($query) or die ("Error in query: $query");

print "$element_20<br /><br /><em>Updated!</em><br /><br />";

++$i;

}

 

 

mysql_close();

?>

<table border="0" cellpadding="0" cellspacing="0" width="100%" height="80">

<tr>

<td align="center"><u><a href="javascript:window.close()">Close</a></u></td>

</tr>

</table>

<div id="footer">

Created by <a href="http://www.#.com.au">###</a>

</div>

</div>

<img id="bottom" src="bottom.png" alt="">

</body>

</html>

<? ?>

Link to comment
Share on other sites

Hello is there any reason why one file in my app would produce a 404 forbidden error?

 

Yes, file or directory permissions and the apache configuration.  You might even be hitting up against a symbolic link issue. 

 

Does this site have one or more .htaccess files? 

 

This is a configuration issue, it has nothing to do with the php code inside the script.

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.