Is there a way to break out of a frame using PHP? I have done it with JavaScript, but I would really prefer to use PHP instead. Thank you.
Frames are a client-side issue. Javascript is the solution, because it is a client-side scripting language that has awareness of the browsing context. Frames are meaningless on the server-side.
So, only client-side code can do this. Not PHP.
PHP is server-side. It merely generates the HTML for a page. As such there is no way for it to determine whether its output is being shown in a frame.
The best PHP can do for you is outputting the Javascript code to break out of a frame.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.