mercredi 22 juin 2016

Allow window.location but prevent direct access to a PHP file

I have a script file named script.php which is accessed from another php file called main.php through the "Window.location" command. I want to prevent direct access to file, i.e, no one can type script.php in the URL bar and view the contents of the file. But I want my main.php to be able to redirect to script.php using window.location. Any way to do this?

I have tried using Debug Backtrace and preg_match() but these are also blocking the window.location from main.php. Any way to get around this?




Aucun commentaire:

Enregistrer un commentaire