Hey today i'm gonna show you how to NOT let people access your iframe directly !
It's quiet simple in JavaScript ;)
here is the code: (make sure you put it above the </head> tag)
<script type="text/javascript"> if (top.location == self.location) { top.location = "FULL-URL-HERE"; } </script>
Just make sure you replace the "FULL-URL-HERE" to the URL you would like to redirect them ;)
And you'r done no one can access your iframe directly :)
It's not great solution as you are doing it on client side. Simple turned off js can access your iframe.
ReplyDelete