jon2s Posted November 8, 2007 Share Posted November 8, 2007 Looking for a solution to this and hopefully someone has a good idea. On my server I have a file that is used to be included on someone else's website. What I am wanting to do is limit the access of which domains can include that file. I have tried to get the host, referer and such, but I cannot get it to return the correct information. Any ideas or did I not explain it very well? Thanks! Jon Quote Link to comment Share on other sites More sharing options...
jon2s Posted November 10, 2007 Author Share Posted November 10, 2007 Any ideas? Anyone? The basic idea is I have a file that I want people to be able to include on their own site, but I want to limit it to specific domains. I think that I could do this with .htaccess, but I'd prefer to do it via PHP so I can query the DB to decide if they can see it and if not display a more friendly error message. Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted November 10, 2007 Share Posted November 10, 2007 Every domain has an IP, or two, or more... these IP's are static, otherwise they wouldn't stay on the web for long. Use .htaccess and allow only those approved IP's. You certainly could do it with PHP too. Stick all of the authorized IP's into an array, then compare incoming IP with in_array. Allow or deny. PhREEEk Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.