将表单操作发送到私人目录

I want to send my form request to a folder which is not public accessible. My directory structure is like this-

  • /home/www/public_html/
    • inc
      • action.php
    • public_html (This is the public directory)
      • form.php (I want to process this form action with action.php)

I tried with this code-

<form action="../inc/action.php" method="POST">

But, it shows 404! Not Found error while I submit the form. It says the path - mysite.com/inc/action.php is not found.

Is there any way in php to process form request in private directories?

You should take a look at the "Front controller" design pattern, https://en.wikipedia.org/wiki/Front_controller

Basically it means you let a file in you public folder (ex. index.php, app.php,...) handle every web request. The code in that file will then determine which files needed to be executed/loaded in your private folder.