How to prevent page opening in iframe using PHP? How is gmail inside iframe?
For PHP you can use.
header("X-FRAME-OPTIONS: DENY");
This is only supported on modern browsers, IE8 +, Firefox 3.6.9, Safari 4, and Chrome. For an older browser, you will also need JavaScript.
You can do it using JavaScript
if( (self.parent && !(self.parent===self)) &&(self.parent.frames.length!=0)){ self.parent.location=document.location }
This will be redirected from the page that opens your page in an iframe on your page.
PHP, - iframe. PHP , - .
JavaScript, , , , - .
Source: https://habr.com/ru/post/1791015/More articles:Unzip a 4gb file in C # - c #What is the best way to store session geolocation results from an IP address using rails? - ruby-on-railsForward stdout to a file in a Qt application - c ++Проблема с сохранением JQuery с вращением изображения - jqueryПроверьте, имеет ли SWF фокус - javascriptAWS SES for Email: Email Verification Required? - amazon-web-servicesUsing a combination of two fields as a key in a dictionary - dictionaryHow can I format (fairly print) a multidimensional array for debugging? - pretty-printWhat is the advantage of RTSP over plain HTTP for static files? - language-agnosticAdding a delay in the application (for debugging) - c #All Articles