Jump to content

[SOLVED] php inlcude


tushar707

Recommended Posts

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):

picture1mh8.jpg

 

 

This is how it looks like when I do the include command: (the menu has tabs that are too short):

picture2bf5.jpg

 

 

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

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.