tushar707 Posted May 13, 2007 Author Share Posted May 13, 2007 thanks for the quick reply. you were so helpful! Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-252053 Share on other sites More sharing options...
tushar707 Posted May 13, 2007 Author Share Posted May 13, 2007 the div thing works for the content. However the menu has a huge problem! This is how it should look like (the tabs are long and sub menu is attached to main menu): This is how it looks like when I do the include command: (the menu has tabs that are too short): Please help why is this happening when the css is the same. Here is the code Index.php (had to save is as .php because .html would not work at all) <html> <head> <title>My Prana</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> body { font-family: VladimirScrD; font-size: 24px; background-color: #0066FF; } #nav, #nav ul { /* all lists */ padding: 0; margin: 0; list-style: none; float : left; width : 149px; } #nav li { /* all list items */ position : relative; float : left; line-height : 29px; margin-bottom : -1px; width: 144px; } #nav li ul { /* second-level lists */ position : absolute; left: -999em; margin-left : 144px; margin-top : -1.20em; } #nav li ul ul { /* third-and-above-level lists */ left: -999em; margin-top : -29px; } #nav li a { width: 5em; w\idth : 5em; display : block; color : #1463a5; font-weight : 300; text-decoration : none; border : none; background-image: url(images/button.jpg); padding-top: 0; padding-right: 0em; padding-bottom: 0; padding-left: 1em; } #nav li a:hover { color : white; background : url(images/button_rollover.jpg); } #nav li:hover ul ul, #nav li:hover ul ul ul, #nav li.sfhover ul ul, #nav li.sfhover ul ul ul { left: -999em; } #nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul { /* lists nested under hovered list items */ left: auto; } #content { margin-left : 1px; } .style1 { font-family: Tahoma; font-size: 12px; color: #593D00; } .style2 {color: #996600} </style> <script type="text/javascript"><!--//--><![CDATA[//><!-- sfHover = function() { var sfEls = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls.onmouseover=function() { this.className+=" sfhover"; } sfEls.onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); //--><!]]></script> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <table width="959" height="860" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01"> <tr> <td colspan="5"> <img src="images/index_01.jpg" width="959" height="214" alt=""></td> </tr> <tr> <td colspan="5"> <img src="images/index_02.jpg" width="959" height="26" alt=""></td> </tr> <tr> <td height="528" colspan="2" background="images/index_03.jpg"> <img src="images/index_03.jpg" width="2" height="486" alt=""></td> <td width="153" height="528" valign="top" bgcolor="54b4e5"> <div align="center"> <?php include("menu.php"); ?></div></td> <td width="803" height="528" valign="top" bgcolor="b9d7ee"><pre><div id="content" name="content">content</div></pre></td> <td width="1" height="528" background="images/index_06.jpg"> <img src="images/index_06.jpg" width="1" height="486" alt=""></td> </tr> <tr> <td rowspan="3"> <img src="images/index_07.jpg" width="1" height="91" alt=""></td> <td colspan="4"> <img src="images/index_08.jpg" width="958" height="16" alt=""></td> </tr> <tr> <td height="74" colspan="3" bgcolor="75c0ea"> <div align="center" class="style2"><span class="style1">My Prana, Inc., 5 North Street, Newtonville, MA 02460.<br> www.my-prana.com; Phone: (617) 939-7626; Fax: (617) 558-9846</span></div></td> <td rowspan="2"> <img src="images/index_10.jpg" width="1" height="75" alt=""></td> </tr> <tr> <td colspan="3"> <img src="images/index_11.jpg" width="957" height="1" alt=""></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="1" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="153" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="803" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="1" height="1" alt=""></td> </tr> </table> <!-- End ImageReady Slices --> </body> </html> Menu.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>My Prana</title> </head> <body> <ul id="nav"> <li><a href="#" onclick="document.getElementById('content').innerHTML = 'click here for the content';">Home</a> </li> <li><a href="#" onclick="document.getElementById('content').innerHTML = 'This is the our programs page.';">Our Programs</a> <ul> <li><a href="#">Climbing perches</a></li> <li><a href="#">Labyrinthfishes</a></li> <li><a href="#">Kissing gouramis</a></li> <li><a href="#">Pike-heads</a></li> <li><a href="#">Giant gouramis</a></li> </ul> </li> <li><a href="#">Resources</a> <ul> <li><a href="#">My Articles</a></li> <li><a href="#">Newsletters</a></li> <li><a href="#">Useful Links</a></li> </ul> </li> <li><a href="#">Events</a> <ul> <li><a href="#">Burrowing gobies</a></li> <li><a href="#">Dartfishes</a></li> <li><a href="#">Eellike gobies</a></li> <li><a href="#">Gobies</a></li> </ul> </li> <li><a href="#">Testimonials</a></li> <li><a href="#">About Me </a></li> <li><a href="#">Contact Us </a></li> </ul> </body> </html> The css is the same that was in the original menu.html file! Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-252409 Share on other sites More sharing options...
tushar707 Posted May 14, 2007 Author Share Posted May 14, 2007 anybody that can help me? Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-252608 Share on other sites More sharing options...
makka Posted May 14, 2007 Share Posted May 14, 2007 <li><a href="#">Xenisthmid[/url]</li> ??? why have you got bb closing tags off Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-252614 Share on other sites More sharing options...
tushar707 Posted May 14, 2007 Author Share Posted May 14, 2007 thats not in the menu.php code above. I dont see it. i dont know what you are talking about. Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-252617 Share on other sites More sharing options...
chigley Posted May 14, 2007 Share Posted May 14, 2007 In your menu.php lose the doctype and <html> and stuff. You just need the stuff that you want to go in the div. Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-252625 Share on other sites More sharing options...
tushar707 Posted May 14, 2007 Author Share Posted May 14, 2007 Is that the problem? for some reason it looks like its more than just that. Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-252627 Share on other sites More sharing options...
neel_basu Posted May 14, 2007 Share Posted May 14, 2007 Hello, i have a CSS menu. I want to do a php include command on every one of my pages on the website. any help on how to do this? Do i need a dynamic site to do this, or is a static site good enough to do php include Is the Problem on include() fixed ?? -------------- If not -------------- First Check 1. You have PHP Installed 2. Add ini_set('display_errors', true); error_reporting(E_ALL); ath the Top of your page 3. Try using .php instead of .html Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-252630 Share on other sites More sharing options...
tushar707 Posted May 14, 2007 Author Share Posted May 14, 2007 the error is not fixed. I think it is a css issue because if I copy and paste the menu instead of php include function the same error happens. Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-252925 Share on other sites More sharing options...
neel_basu Posted May 14, 2007 Share Posted May 14, 2007 Paste all your Css / Javascript / HTML codes on a file and name it menu.html and include_once('menu.html'); Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-252927 Share on other sites More sharing options...
tushar707 Posted May 14, 2007 Author Share Posted May 14, 2007 the problem seems to be with the css not the php i think. I will do what you told me and paste it here. Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-252937 Share on other sites More sharing options...
tushar707 Posted May 14, 2007 Author Share Posted May 14, 2007 okay. I think I fixed the problem, but have another problem. In this: onclick="document.getElementById('content').innerHTML = 'CONTENT';" The area where it says CONTENT can I include a php include command there? Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-253000 Share on other sites More sharing options...
tushar707 Posted May 14, 2007 Author Share Posted May 14, 2007 okay there is a huge problem onclick="document.getElementById('content').innerHTML = 'CONTENT';" In that command, I cannot enter any html in the content area! I cannot stylize text or even enter php include command! Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-253057 Share on other sites More sharing options...
tushar707 Posted May 14, 2007 Author Share Posted May 14, 2007 sorry to post so many things but also my css menu works fine in firefox but looks terrible in IE. whats up with that! any help will be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-253107 Share on other sites More sharing options...
chronister Posted May 15, 2007 Share Posted May 15, 2007 Welcome to the world of Crappy CSS support in IE. Internet Destroyer (Explorer) has long been a pain in the ass for web developers regarding CSS support. It is something ALL web developers run into. There are hacks and work arounds for this piece of SH#% Browser. MS basically feels that they are exempt of following the rules that govern the web. They are more interested in creating F-ed up "standards" of their own. IE don't like to ignore whitespaces in the code, make your menu code look like this <ul id="nav"><li><a href="#" onclick="document.getElementById('content').innerHTML = 'click here for the content';">Home</a></li><li><a href="#" onclick="document.getElementById('content').innerHTML = 'This is the our programs page.';">Our Programs</a><ul><li><a href="#">Climbing perches</a></li><li><a href="#">Labyrinthfishes</a></li><li><a href="#">Kissing gouramis</a></li><li><a href="#">Pike-heads</a></li><li><a href="#">Giant gouramis</a></li></ul></li> It should not matter, as white space in the code is supposed to be ignored, and just follow what the actual code is telling it to do, but IE has this bug. I had a problem using a <li> based menu once and it was solved by the above suggestion. Nate Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-253176 Share on other sites More sharing options...
tushar707 Posted May 15, 2007 Author Share Posted May 15, 2007 thats not fixing the problem. Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-253433 Share on other sites More sharing options...
tushar707 Posted May 15, 2007 Author Share Posted May 15, 2007 anybody else who can help me? Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-253839 Share on other sites More sharing options...
ldoozer Posted May 15, 2007 Share Posted May 15, 2007 Hi all, I have a question about included thats bugging me. I have used included and changed my html files to php files, but now my website pages seem to take twice as long to load. I have tested this on different connections and computers. Does using includes dramatically slow the pages down? Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-253871 Share on other sites More sharing options...
tushar707 Posted May 15, 2007 Author Share Posted May 15, 2007 can you post how you use html within includes, because I dont seem to be able to do it. Like can you post your include command with the sample content? Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-253892 Share on other sites More sharing options...
chronister Posted May 16, 2007 Share Posted May 16, 2007 Hi all, I have a question about included thats bugging me. I have used included and changed my html files to php files, but now my website pages seem to take twice as long to load. I have tested this on different connections and computers. Does using includes dramatically slow the pages down? You really should not hijack another persons post. If you need help, start a new topic. I have not had any problems using includes though in regards to speed. Start a new topic, and post some code so we can see what is happening. Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-254093 Share on other sites More sharing options...
ldoozer Posted May 16, 2007 Share Posted May 16, 2007 Sorry I thought it might be helpful for this person to know if includes would slow their website down. Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-254296 Share on other sites More sharing options...
tushar707 Posted May 16, 2007 Author Share Posted May 16, 2007 is there a substitute to "innerHTML" because include doesn't slow the website Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-254357 Share on other sites More sharing options...
ldoozer Posted May 21, 2007 Share Posted May 21, 2007 sorry dont understand the question. Quote Link to comment https://forums.phpfreaks.com/topic/51140-solved-php-inlcude/page/2/#findComment-258470 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.