views:

33

answers:

1

Hi. I have a a login in script that is a little to complicated for my own good. I have a php file that calls a javascript based on the $_GET variable. The javascript/jquery makes html that uses iframe to call another php file, but I need the $_GET variable in that php code or I need to pass the $_GET variables to the other php file within Iframe in another way. I could to this with a cookie, but was hoping there was a better way of doing it. Getting the $_GET variables from the url would be the best way I think.

To sum up. I have a php file that is called like this <iframe src ="site.php" in site.php I need the $_GET variables from the URI, but that shows up blank..

I also tries this '<iframe src ="site.php?'.http_build_query($_GET).'" with no luck

Here is a more detailed version of the structure:

+2  A: 

http_build_query() is exactly the right way to go about this. If you are doing this in the page that gets the GET parameters, the code you show should be working.

Pekka
If it doesn't work, look into the generated source code and copy+paste the link here.
Pekka