This is the structure
- index.php
- app/processor.php
- app/.htaccess
in the index.php I have this form
<form method='post' action='/app/processor.php'>
<input type='text' name='foo' value=''/>
<input type='submit' value='bar'/>
</form>
The file which will process the form is located inside the app folder. The processor.php has the code:
<?php
if(isset($_POST['foo'])){
echo "foo is set";
}
?>
And inside the app folder, I created a .htaccess to deny direct access of the files inside of it.
Order deny,allow
Deny from all
My problem now is that I can’t process the form due to the .htaccess file. The server returns error 403 because of that restriction in the app folder. Is there anyway I can process the form by still using the processor.php? Or should I remove/modify the .htaccess? Thanks for your answers!
Above the
Order deny,allowyou can always add a section like:And it should allow that specific file to be read, while everything else remains forbidden.