For security reasons I want to have all my connection files to the DB and login files in a folder out of the root directory. Like this:
Project:
includes:
conncect.php
process_login.php
general_files:
index.php
In my index.php i have the following.
<form action="../includes/process_login.php" method="post" name="login_form">
[...]
</form>
The problem is that when i try to submit that form i get an error that says that:
The requested URL /includes/process_login.php was not found on this server.
Does anyone knows a way to do what i want to do?
It appears that your document root is <Project>/general_files
, and if that's the case, then your process_login.php
file is outside of the public web folder.
You have two options:
1) Move process_login.php
to the general_files/
directory and update the action
attribute accordingly:
Project:
includes:
conncect.php
general_files:
index.php
process_login.php
2) Or add a new PHP file (eg, new_login.php
) to general_files/
that includes process_login.php
, and set your form's action
attribute to this file:
Project:
includes:
conncect.php
process_login.php
general_files:
index.php
new_login.php
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.