ebolt007 Posted October 7, 2011 Share Posted October 7, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/248590-_get-from-iframe-child/ Share on other sites More sharing options...
ebolt007 Posted October 7, 2011 Author Share Posted October 7, 2011 Can anyone please help me on this? I still can't find any information for it, everything online is to send the variable to the child, not get from it. Quote Link to comment https://forums.phpfreaks.com/topic/248590-_get-from-iframe-child/#findComment-1277084 Share on other sites More sharing options...
requinix Posted October 7, 2011 Share Posted October 7, 2011 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); Quote Link to comment https://forums.phpfreaks.com/topic/248590-_get-from-iframe-child/#findComment-1277089 Share on other sites More sharing options...
ebolt007 Posted October 7, 2011 Author Share Posted October 7, 2011 I'm not very good with javascript tho, so how would I create such a function then get this function out of the iframe.php and into the index.php? Thanks btw for moving this to the correct forum. Quote Link to comment https://forums.phpfreaks.com/topic/248590-_get-from-iframe-child/#findComment-1277091 Share on other sites More sharing options...
requinix Posted October 7, 2011 Share Posted October 7, 2011 Put a Put another Quote Link to comment https://forums.phpfreaks.com/topic/248590-_get-from-iframe-child/#findComment-1277095 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.