ThunderAI Posted June 15, 2008 Share Posted June 15, 2008 in the php help section there is a topic about preventing direct access to a php file unless it is in an iframe. in order to tell this i used this function. <script> var youraterrorist if (top.location == self.location) { alert('your bad'); document.write('your bad'); youraterrorist = 1; } else { alert('your good'); youraterrorist = 0; } </script> is it possible for the javascript to actally terminate the rest of the file if this test fails? Quote Link to comment Share on other sites More sharing options...
bearruler Posted June 15, 2008 Share Posted June 15, 2008 JavaScript is executed by the web browser after the entire page has loaded. You could just send them to a different location, but they could easily get around it by disabling JavaScript. If you want to keep someone out of somewhere, use server-side authentication. Bruce Quote Link to comment Share on other sites More sharing options...
ThunderAI Posted June 15, 2008 Author Share Posted June 15, 2008 JavaScript is executed by the web browser after the entire page has loaded. You could just send them to a different location, but they could easily get around it by disabling JavaScript. If you want to keep someone out of somewhere, use server-side authentication. Bruce Is just checking the value in a session user id ok. I was able to do that and everything works how i want it to; however, would there be a better way? 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.