/    Sign up×
Community /Pin to ProfileBookmark

Get url of a iFrame

Hi, i’m new on this forum.
I need to get a url of an iframe from a form.
A parent php page with an iframe, in the iframe the user can navigate and when the user has found his page click a button on the php parent page that send a variable to another php page with the frame url.
It is possibile?

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@marcolettieriauthorOct 09.2012 — The only thing i don't know how to do is to get the url of the frame. please help
Copy linkTweet thisAlerts:
@hastxOct 10.2012 — I think you want to use javascript to communicate across frames. even if you could use PHP, the user experience would not be that great... probably involve page refreshes.
Copy linkTweet thisAlerts:
@NogDogOct 10.2012 — If both the parent page and the iframe page are on the same domain, you can access functions in the parent from the iframe via JavaScript as:
<i>
</i>window.parent.functionName()

If they are on different domains, it's possible, but gets quite a bit more convoluted (and I'm not sure I could explain it correctly without doing a lot of research first).
Copy linkTweet thisAlerts:
@marcolettieriauthorOct 11.2012 — i don't know javascript =(

it's no possibile with php?
Copy linkTweet thisAlerts:
@ZABIOct 11.2012 — post your code here, then we can help.
Copy linkTweet thisAlerts:
@marcolettieriauthorOct 11.2012 — PARENT PAGE:
[CODE][...]
$url=www.google.it;
echo ("<form method=GET action=geturl.php>
<p><iframe src=".$url.">
</iframe></p>
<p><input type=submit value=Invia></p>
</form>");
[...][/CODE]

THE FRAME IS A WEBSITE, BETHINK GOOGLE, the user can navigate on the frame and when has found the following webpage click on the submit and send the variable $url that will contain the url of the webpage to geturl.php.
×

Success!

Help @marcolettieri 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...