I read it's good practice to store php files containing potentially security risk stuff outside the root directory.
Now I have php files containing stuff for proccessing a registration/login. Those are outside the root directory. Now I catch the form content via jquery and send it to this php file.
But this seems not to be possible with js/jquery:
$.ajax({
type: "POST",
url: "../php_includes/register.inc.php", //beyond root path
data: data,
})
.done(function(data, status) {
//...
});
Do I have a design error or just doing something wrong?
Whats the "best practice" solution here?