Sunday 5 June 2011

Changing the src url for an iframe with a url?

Is it possible to change the url of an iframe with the url of the main page? For example you have an iframe on the index.php page and you go to links.html and click on a link like %26quot;index.php?iframe_main src = lol.html%26quot; then it will redirect you to the main page and change the src url in the iframe to that link? Is this possible?|||I%26#039;m not exactly sure what you%26#039;re asking but if you want to put the HTTP Request variable as the iframe source using PHP, it would look something like this:





%26lt;iframe src=%26quot;%26lt;?=$_REQUEST[%26quot;iframesrc%26quot;]?%26gt;%26quot;%26gt;


%26lt;/iframe%26gt;





Assuming the url was %26quot;./index.php?iframsrc=lol.html%26quot; then lol.html would be shown in the iframe.





Hope this helps :)





Daniel Dutton


Shore Dutton Internet Consultancy