I have uploaded scripts to users servers. I don't want others to access this script through the browser, However, I want a script to be able to access it.
Placing the file outside of the public_html is not an option here,because it really needs to be in the public_html. Any ideas??? thanks.
Put some variable before the include so you know where it is being called:
index.php:
$open = true;
include 'open.php';
open.php:
<?php
if(isset($open) && $open){
//do what it is supposed to do
}
else {
header("HTTP/1.1 403 Forbidden");
exit;
}
?>
If by scripts you mean server-side, you can add a .htaccess
file in the folder concerned:
deny from all
If however by script you mean client-side, then ultimately you can't.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With