Click to See Complete Forum and Search --> : passing $GET variables to an iFrame


mistafeesh
10-22-2007, 10:31 AM
Hi,

I want to pass some (or all) of the $GET info to an iFrame in a php page.

Here's the code I've written so far:
<iframe
src ="clientarea2/index.php?cPath=<?php echo $_GET['cPath']; ?>"
width="650"
height="700"></iframe>

As you can guess, it don't work!! The HTML code it generates seems fine (as in it forms the URL with the 'get' information intact) but the page loads into the iFrame without the $GET anywhere to be seen...


any ideas?

I also need to figure out how to get the iFrame to stretch dynamically to fit the available space, but that's another query, unless anyone's got some handy hints!

ixxalnxxi
10-22-2007, 12:42 PM
that seems correct, try echoing $_GET['cPath']; on another part of the page to see if it even contains anything.

mistafeesh
10-22-2007, 01:47 PM
Ahah! I didn't change anything, but it now works...! I went back to it to see whether I could echo the variable on the page as you suggested, and it was working! I don't know why but maybe my local server was misbehaving for some reason?

PS I think I found a script to help with the stretchyness problem too, on this page (http://guymal.com/mycode/100_percent_iframe/). I'll post again if I can't get that to work!

Cheers,

Dan