Basically I have an IFRAME that contains a given page – I want to be able to remove all anchor links and form targets so that the user is not able to navigate to other pages within the IFRAME. Is this possible to do?
<iframe src="<?php echo $url; ?>"></iframe>
EDIT: RobinUS2 has provided a solution below, however how do I now remove all JavaScript events on the page?
If you insist on using PHP for doing this you should fetch the page and process it. Use a function like “file_get_contents()” and a regex to modify the HTML output.
However you might also consider using something like jQuery to dynamically manipulate the iframe.
In jQuery you can do something like: