I have a php script which updates a database. I want to be sure that no one else can call my script remotely and execute it.
I tried this code but it did not work, the refer was always empty because I use https connection.
if (strpos($_SERVER['HTTPS_REFERER'], 'linkedfilm.com') == false)
{
exit();
}
The server is Apache server.
Thanks.
2
Answers
You could use .htaccess and put your script in a password protected directory.
Or you could use some sort of login and authentication routines on your site so you can login and access that script.
Or you could pass a ‘secret’ key with you call to the script, quick and dirty
Hello Daina Hodges,
You got a few options to secure this .php script.