i need to prevent visitors from opening a page outside iframe
for example
when write on browser :
www.sss.com/index.php
will be open
but when write
www.sss.com/add_news.php
i need to redirect to home page
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since an iframe makes a GET request there isn’t really any way to distinguish a GET request coming from the browser itself and one coming from an iframe embedded in a page. In both cases the browser makes the same GET request. You could probably write some JavaScript code in your “iframe” page that detects whether or not it is loaded in the top window and redirects if it isn’t.
From the accepted answer on How to identify if a webpage is being loaded inside an iframe or directly into the browser window?
using the window properties
topandself