Forum Moderators: coopster
I have created a php script that serves up images based on user text input. How do I limit access to the script to those that are using the script on my server/site? Right now anyone can call the script from anywhere which is going to eat my bandwidth.
I have tried doing .htaccess restrictions
//ErrorDocument 404 /index.htm
// SetEnvIfNoCase Referer "^http://myURL" local_ref=1
// <FilesMatch "\.(php)">
// Order Allow,Deny
// Allow from env=local_ref
// </FilesMatch>
Works fine but referrer can be turned off on users machine .. private headers disabled by firewall etc: which causes a broken link on my site.
So, anyone know how the php script itself can check if the call to the script is originating from my server?