brentmoeller Posted March 6, 2011 Share Posted March 6, 2011 maybe some wiz kid out their can help me figure out whats going on here. What suppose to happen is a random site suppose to load into a iframe When the frameset code below is inside the <body> tags only the menubar shows up and not the iframe with a random site. Now when i take the code and put it oustide the <body> tag the menubar goes away and only the iframe with a random site is shown . The goal of course is to get the menubar to be visible and to have a iframe with a random site loaded into it. For some reason i can only get one of the two the happen. I do hope i explained this well enough <frameset rows="80,*" BORDERCOLOR="#222222" BORDER="3"> <frame src="explore.php" name="surfbar" marginwidth="O" marginheight="0" NORESIZE SCROLLING="no" /> <frame src="<?php while ($row = mysql_fetch_array($result)){ print $row["url"];}?> " name="random" marginwidth="O" marginheight="0" noresize scrolling="auto" /> </frameset> -------------------------------------------------------------------------------------------------- <?php /** * @author Brent Moeller * @copyright 2011 */ include ('functions.php'); db_connect(); $result = mysql_query("SELECT * FROM slinks where approval='1' ORDER BY RAND() LIMIT 1") or die(mysql_error()); ?> <html> <head> <title>DizzyUrl Discovery Engine</title> <link rel="stylesheet" type="text/css" href="mouseovertabs.css" /> <script src="mouseovertabs.js" type="text/javascript"> /*********************************************** * Mouseover Tabs Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more ***********************************************/ </script> </head> <body> <frameset rows="80,*" BORDERCOLOR="#222222" BORDER="3"> <frame src="explore.php" name="surfbar" marginwidth="O" marginheight="0" NORESIZE SCROLLING="no" /> <frame src="<?php while ($row = mysql_fetch_array($result)){ print $row["url"];}?> " name="random" marginwidth="O" marginheight="0" noresize scrolling="auto" /> </frameset> <div id="mytabsmenu" class="tabsmenuclass"> <ul> <li><a href="http://www.javascriptkit.com" rel="gotsubmenu[selected]">JavaScript Kit</a></li> <li><a href="http://www.cssdrive.com" rel="gotsubmenu">CSS Drive</a></li> <li><a href="http://www.codingforums.com">No Sub Menu</a></li> </ul> </div> <div id="mysubmenuarea" class="tabsmenucontentclass"> <!--1st link within submenu container should point to the external submenu contents file--> <a href="submenucontents.htm" style="visibility:hidden">Sub Menu contents</a> </div> <script type="text/javascript"> //mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout") mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", true) </script> <noframes> <p>This Browser does not support Frames.</p> </noframes> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/229811-one-works-other-dont/ Share on other sites More sharing options...
DavidAM Posted March 6, 2011 Share Posted March 6, 2011 FRAMESET and IFRAME are two different things. A FRAMESET is the body of a document (without BODY tags) an IFRAME is an embedded element similar to an IMG. Quote Link to comment https://forums.phpfreaks.com/topic/229811-one-works-other-dont/#findComment-1183738 Share on other sites More sharing options...
redarrow Posted March 6, 2011 Share Posted March 6, 2011 well spotted, you need iframe well done above. Quote Link to comment https://forums.phpfreaks.com/topic/229811-one-works-other-dont/#findComment-1183743 Share on other sites More sharing options...
brentmoeller Posted March 6, 2011 Author Share Posted March 6, 2011 Great so that answers the question that it needs to be outside of the body making the new code look like this <?php /** * @author Brent Moeller * @copyright 2011 */ include ('functions.php'); db_connect(); $result = mysql_query("SELECT * FROM slinks where approval='1' ORDER BY RAND() LIMIT 1") or die(mysql_error()); ?> <html> <head> <title>DizzyUrl Discovery Engine</title> <link rel="stylesheet" type="text/css" href="mouseovertabs.css" /> <script src="mouseovertabs.js" type="text/javascript"> /*********************************************** * Mouseover Tabs Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more ***********************************************/ </script> </head> <frameset rows="80,*" BORDERCOLOR="#222222" BORDER="3"> <frame src="explore.php" name="surfbar" marginwidth="O" marginheight="0" NORESIZE SCROLLING="no" /> <frame src="<?php while ($row = mysql_fetch_array($result)){ print $row["url"];}?> " name="random" marginwidth="O" marginheight="0" noresize scrolling="auto" /> </frameset> <body> <div id="mytabsmenu" class="tabsmenuclass"> <ul> <li><a href="http://www.javascriptkit.com" rel="gotsubmenu[selected]">JavaScript Kit</a></li> <li><a href="http://www.cssdrive.com" rel="gotsubmenu">CSS Drive</a></li> <li><a href="http://www.codingforums.com">No Sub Menu</a></li> </ul> </div> <div id="mysubmenuarea" class="tabsmenucontentclass"> <!--1st link within submenu container should point to the external submenu contents file--> <a href="submenucontents.htm" style="visibility:hidden">Sub Menu contents</a> </div> <script type="text/javascript"> //mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout") mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", true) </script> <noframes> <p>This Browser does not support Frames.</p> </noframes> </body> </html> Now the random site pops up but the menu bar isnt visible anymore. Why wold this be? Quote Link to comment https://forums.phpfreaks.com/topic/229811-one-works-other-dont/#findComment-1183753 Share on other sites More sharing options...
DavidAM Posted March 7, 2011 Share Posted March 7, 2011 Sorry, I should have explained more. FRAMESET (which has been depricated) actually REPLACES the body. Each FRAME in the FRAMESET creates a separate "document" to show. If the FRAMESET is shown in the browser, it will NOT also show the BODY element. In fact, I don't think it is valid to have a BODY in an HTML file with a FRAMESET (except possibly in the NOFRAMES section). If you are set on using FRAMESET, the menu stuff (that you currently have in the BODY) needs to be included using a FRAME that references a separate file. If you want to use an IFRAME, forget the whole FRAMESET thing, build the BODY as you want it using an IFRAME where you want the random site loaded - stick it in just like you would an IMG tag. Quote Link to comment https://forums.phpfreaks.com/topic/229811-one-works-other-dont/#findComment-1183773 Share on other sites More sharing options...
brentmoeller Posted March 7, 2011 Author Share Posted March 7, 2011 Sorry, I should have explained more. FRAMESET (which has been depricated) actually REPLACES the body. Each FRAME in the FRAMESET creates a separate "document" to show. If the FRAMESET is shown in the browser, it will NOT also show the BODY element. In fact, I don't think it is valid to have a BODY in an HTML file with a FRAMESET (except possibly in the NOFRAMES section). If you are set on using FRAMESET, the menu stuff (that you currently have in the BODY) needs to be included using a FRAME that references a separate file. If you want to use an IFRAME, forget the whole FRAMESET thing, build the BODY as you want it using an IFRAME where you want the random site loaded - stick it in just like you would an IMG tag. Thanks a Shi$ ton i got it to work by taking your advice One more fast question. is it even possible to remove the scroll bars when using a iframe? As you can see in the picture there is a scroll bar even tho i have with height and width set to 100% Heres the new code i used after taking your advice <?php /** * @author Brent Moeller * @copyright 2011 */ include ('functions.php'); db_connect(); $result = mysql_query("SELECT * FROM slinks where approval='1' ORDER BY RAND() LIMIT 1") or die(mysql_error()); ?> <html> <head> <link rel="stylesheet" type="text/css" href="mouseovertabs.css" /> <script src="mouseovertabs.js" type="text/javascript"> /*********************************************** * Mouseover Tabs Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more ***********************************************/ </script> <title>DizzyUrl Discovery Engine</title> </head> <body> <div id="mytabsmenu" class="tabsmenuclass"> <ul> <li><a href="http://localhost/Stumble/explore.php" rel="gotsubmenu[selected]">Stumble</a></li> <li><a href="http://www.cssdrive.com" rel="gotsubmenu">CSS Drive</a></li> <li><a href="http://www.codingforums.com">No Sub Menu</a></li> </ul> </div> <div id="mysubmenuarea" class="tabsmenucontentclass"> <!--1st link within submenu container should point to the external submenu contents file--> <a href="submenucontents.htm" style="visibility:hidden">Sub Menu contents</a> </div> <script type="text/javascript"> //mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout") mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", true) </script> <iframe> <iframe src="<?php while ($row = mysql_fetch_array($result)){ print $row["url"];}?> " name="surfbar" width="100%" height="100%"> noresize scrolling="auto" /> </iframe> </body> </html> http://felonygames.com/uploads/images/FelonyGames.com-1299461612-U1.jpg Quote Link to comment https://forums.phpfreaks.com/topic/229811-one-works-other-dont/#findComment-1183804 Share on other sites More sharing options...
brentmoeller Posted March 7, 2011 Author Share Posted March 7, 2011 i found out SCROLLING=NO or our auto Im starting to think that results im looking for cant be dont in a iframe. I would like the user to have to use the Browser to scroll if its required and not a scroller on the Iframe Quote Link to comment https://forums.phpfreaks.com/topic/229811-one-works-other-dont/#findComment-1183815 Share on other sites More sharing options...
DavidAM Posted March 7, 2011 Share Posted March 7, 2011 Sorry, I don't know much about IFRAME. I played with it once, just to try to understand why the W3C would throw-away a perfectly good element (FRAMESET) and create the IFRAME. I still don't understand. Personally, I prefer the FRAMESET. I'm sure someone else with more experience will chime in here. Quote Link to comment https://forums.phpfreaks.com/topic/229811-one-works-other-dont/#findComment-1183827 Share on other sites More sharing options...
brentmoeller Posted March 7, 2011 Author Share Posted March 7, 2011 yeah i just found out its possible to do www.spinsnap.com/spin.php this site here is using a Iframe like i am and as you can see they only have one scroll bar. I tried to be sneaky and add <body style="overflow: hidden"> but it failed to give me the desired results i was looking for.. Quote Link to comment https://forums.phpfreaks.com/topic/229811-one-works-other-dont/#findComment-1183835 Share on other sites More sharing options...
brentmoeller Posted March 7, 2011 Author Share Posted March 7, 2011 <body style="overflow: hidden"> I take that back the above code did give me my deisred results Thanks everyone for the help Quote Link to comment https://forums.phpfreaks.com/topic/229811-one-works-other-dont/#findComment-1183840 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.