boemboem Posted February 20, 2009 Share Posted February 20, 2009 Hello all, I have found this sollutions once, but I cant find it anymore. This is what I'm trying to do this is the link on my frontpage (index.php): <a href=\"{$path}viewtopic.php?t={$topic['topic_id']}\">{$topic['topic_title']}</a> I want this to be opend in a page called "include_forum.php" in an iframe called "Myframe" Does anyone know how to fix this? Link to comment https://forums.phpfreaks.com/topic/146105-open-string-in-iframe-on-another-page/ Share on other sites More sharing options...
boemboem Posted February 20, 2009 Author Share Posted February 20, 2009 I have found this, but it isn't working properly. it does target to the Iframe, but doens´t open the part after the question mark (?) ?http://www.coldcharlie.nl/phpbb/viewtopic.php?t={$topic['topic_id']}\"> Head section in include_forum.php <script type="text/javascript"> function loadframe(){ if(window.location.replace) window.frames.myframe.location.replace(get('framepage')); else window.frames.myframe.location.href=get('framepage'); } function get(key_str) { var query = window.location.search.substr(1); var pairs = query.split("&"); for(var i = 0; i < pairs.length; i++) { var pair = pairs[i].split("="); if(unescape(pair[0]) == key_str) return unescape(pair[1]); } return null; } if (location.search&&get('framepage')!=null) if ( typeof window.addEventListener != "undefined" ) window.addEventListener( "load", loadframe, false ); else if ( typeof window.attachEvent != "undefined" ) window.attachEvent( "onload", loadframe ); else { if ( window.onload != null ) { var oldOnload = window.onload; window.onload = function ( e ) { oldOnload( e ); loadframe(); }; } else window.onload = loadframe; } </script> The Iframe on include_forum.php <iframe id="myframe" name="myframe" src="/phpbb/index.php" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" width="977" align="middle"></iframe> This is the part with the link in it on recent-topics.php <td><a href=\"include_forum.php?http://www.coldcharlie.nl/phpbb/viewtopic.php?t={$topic['topic_id']}\">{$topic['topic_title']}</a></td> Link to comment https://forums.phpfreaks.com/topic/146105-open-string-in-iframe-on-another-page/#findComment-767058 Share on other sites More sharing options...
boemboem Posted February 20, 2009 Author Share Posted February 20, 2009 Wrong forum i quess. Link to comment https://forums.phpfreaks.com/topic/146105-open-string-in-iframe-on-another-page/#findComment-767074 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.