Jump to content

$_GET from iframe Child


ebolt007

Recommended Posts

I'll try to explain the best I can, everything online $_GET's information from the parent to the child, which I can do, I just can't go in reverse. So I have a site, with a calendar and buttons. When a date is clicked on it modifies the iframe with that date's month and day in the iframe url. ie: http://www.url.com/page.php?mon=201110&day=7  I need to get the mon and day from the child iframe URL so I can put this on other buttons on the parent url. I can't figure out how to get these and turn them into a variable tho. Basically as simple as...

$cur_mon = $_GET['mon'];
$cur_day = $_GET['day'];
        //link to open iframe with correct mon and day generated
echo "<a href=\"iframe.php?mon=$cur_mon&day=$cur_day\"  target=\"iframe\">Event for $cur_mon</a>\n";

 

I just can't figure out what to ad to the $_GET, or from what I've been reading, how to integrate the javascript to pull the mon and day from the iframe url.

 

Thanks

Link to comment
Share on other sites

PHP can't do anything with frames so you're left with using JavaScript.

 

Create a function on the parent page that takes the month and day and does whatever you want it to do.

Inside the iframe.php you can call that function:

parent.whatever_function_you_made($cur_mon, $cur_day);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.