/    Sign up×
Community /Pin to ProfileBookmark

passing $GET variables to an iFrame

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:

[code]<iframe
src =”clientarea2/index.php?cPath=<?php echo $_GET[‘cPath’]; ?>”
width=”650″
height=”700″></iframe>[/code]

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!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@ixxalnxxiOct 22.2007 — that seems correct, try echoing $_GET['cPath']; on another part of the page to see if it even contains anything.
Copy linkTweet thisAlerts:
@mistafeeshauthorOct 22.2007 — 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 [url=http://guymal.com/mycode/100_percent_iframe/]this page[/url]. I'll post again if I can't get that to work!

Cheers,

Dan
×

Success!

Help @mistafeesh spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...