With PHP, no. With JavaScript, yes. <script type="text/javascript"> if (self != top) { alert("I'm in a frame!"); } </script> HTML:
thanks for the comments but i dont want to use java script. i need to find a way to prevent it without javascript
i'm afraid you'll be disappointed here. such info is not something that can be accessed / controlled from a server-side language like php.
If you know what site is framing your php file, you can check the referrer. if($_SERVER['HTTP_REFERRER'] == "http://thatdarnsitethatlinksinframes.com/") { die("I don't like frames!"); } PHP:
mine is a bit stupid question as i know proxy sites are using frames to cache (or cheat) the pages. i have content based web site. i have been hijacked by proxy sites . i'm being hijacked by a new proxy site every day . i can not use java sciript because proxy sites are removing java script codes. i need somethink which proxy sites will not be able to remove (like php) from codes. i'm making a brain storm for this
Is checking for JavaScript an alternative? If JS is not enabled, assume it's not legitimate traffic / user.
proxies are not playing the this game with the rules. proxy sites has become the another way of cheating. i need to protect myself against the proxy sites. i need somethink server side alternative like php for these cheaters.