Stavros Posted June 13, 2011 Share Posted June 13, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/239238-forbidden-you-dont-have-permission-to-access/ Share on other sites More sharing options...
gizmola Posted June 13, 2011 Share Posted June 13, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/239238-forbidden-you-dont-have-permission-to-access/#findComment-1229293 Share on other sites More sharing options...
Stavros Posted June 14, 2011 Author Share Posted June 14, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/239238-forbidden-you-dont-have-permission-to-access/#findComment-1229356 Share on other sites More sharing options...
gizmola Posted June 14, 2011 Share Posted June 14, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/239238-forbidden-you-dont-have-permission-to-access/#findComment-1229369 Share on other sites More sharing options...
Stavros Posted June 14, 2011 Author Share Posted June 14, 2011 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> <? ?> Quote Link to comment https://forums.phpfreaks.com/topic/239238-forbidden-you-dont-have-permission-to-access/#findComment-1229452 Share on other sites More sharing options...
Stavros Posted June 20, 2011 Author Share Posted June 20, 2011 Hello is there any reason why one file in my app would produce a 404 forbidden error? Quote Link to comment https://forums.phpfreaks.com/topic/239238-forbidden-you-dont-have-permission-to-access/#findComment-1232043 Share on other sites More sharing options...
gizmola Posted June 20, 2011 Share Posted June 20, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/239238-forbidden-you-dont-have-permission-to-access/#findComment-1232414 Share on other sites More sharing options...
Stavros Posted July 3, 2011 Author Share Posted July 3, 2011 Ok this one was to do with my host they have since enabled some rule (didn't say which one) to allow script to run, problem solved. cheers Quote Link to comment https://forums.phpfreaks.com/topic/239238-forbidden-you-dont-have-permission-to-access/#findComment-1237849 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.