Jump to content

PHP include() function, need some HELP HERE!


jowdilla

Recommended Posts

Firstable I would like to say HELLO to the community, this is my first post here and I wish I would solve this problem that is anoying me for 2 days.

 

So my issue is  :wtf::

 

I have my main PHP file(index) with this code:

<!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=utf-8" />
<title>Tarot Online - Carla Caessa</title>
<style type="text/css">
<!--
body {
background-image: url(images/primary_purple/diamonds.jpg);
}
-->
</style></head>

<body>



<table width="1024" border="0" cellspacing="0" cellpadding="0" align="center">

<tr>
<td colspan="3" height="97px" background="images/tarotcctemplate_CORTADO_LAYOUT_01.png"> </td>
</tr>
<tr>


    <td width="163" rowspan="2" background="images/tarotcctemplate_CORTADO_LAYOUT_02.png"></td>
    <td width="487" height="26" background="images/tarotcctemplate_CORTADO_LAYOUT_02-03.png" <?PHP include "menu_principal.php" ?> ></td>
    
    <td width="374" rowspan="2" background="images/tarotcctemplate_CORTADO_LAYOUT_04.png"></td>
  </tr>
    
<tr>

    <td height="385" background="images/tarotcctemplate_CORTADO_LAYOUT_05.png"><table width="487" border="0" cellspacing="0" cellpadding="0">

    </table></td>
  </tr>
  <tr>
    <td background="images/tarotcctemplate_CORTADO_LAYOUT_06.png"> </td>
    <td height="515" background="images/tarotcctemplate_CORTADO_LAYOUT_06-07.png"> </td>
    <td background="images/tarotcctemplate_CORTADO_LAYOUT_08.png"> </td>
  </tr>
  <tr>
    <td colspan="3" background="images/tarotcctemplate_CORTADO_LAYOUT_09.png" height="74"> </td>
  </tr>
</table>


</body>
</html>

 

So as you noticed I have a line in PHP that calls my main menu file called "menu_principal.php". I've tried several ways with space, none space, require instead include and none of them worked well.

 

That said, with this code that I did apply above we'll check something like this:

wtfbug.th.png

 

What's wrong with that?

 

Later on, I'll show you what should it look like... like this (with the menu, of course):

normalstate.png

 

Ok, after you check that all I also let the code from my menu_princpal.php for you professional PHP coders check it out. Here it is:

<!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=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.LinkCSSstyle {
font-family: Tahoma, Geneva, sans-serif;
font-style: normal;
text-transform: uppercase;
color: #FFF;
}
-->
</style>
</head>

<body>
<table width="487" border="0" cellspacing="0" cellpadding="0" height="26">
  <tr>
    <td align="center">Início</td>
    <td align="center">Tarot Online</td>
    <td align="center">Consultório</td>
    <td align="center">F.A.Q.</td>
  </tr>
</table>
</body>
</html>

 

Just a picture of the code:

menumain.png

 

I really apreciate if you guys help me on this.

 

Many thanks in advance,

Peace.

 

Jow

 

Link to comment
Share on other sites

then the menu_principal.php page would only contain this.

 

<table width="487" border="0" cellspacing="0" cellpadding="0" height="26">
  <tr>
    <td align="center">Início</td>
    <td align="center">Tarot Online</td>
    <td align="center">Consultório</td>
    <td align="center">F.A.Q.</td>
  </tr>
</table>

 

any css on that page should wither be in the parent page or in an external .css file.

 

that being said, you should also edit this line to match this:

 

<td width="487" height="26" background="images/tarotcctemplate_CORTADO_LAYOUT_02-03.png"> <?php include "menu_principal.php" ?></td>

 

also, the use of tables should be for tabular data, not the overall layout of your markup, use lists instead.

Link to comment
Share on other sites

Thanks, AltarofScience, where should I apply that?

 

I made my design organized by a table, each column and row has its own bg image. I made that without CSS, am I doing it right, is there a simple and cleaning way to do this?

 

Thanks.

Link to comment
Share on other sites

look at the browsers view source to see what the markup looks like. Then position the include to where the table that it contains should be. But I must ask, why are you storing a singular table in an include file? why not hard code it?

Link to comment
Share on other sites

I used to code some in C++, php for me its very new... I would like that you explain to me some things. What you mean creating with lines instead of tables, am I doing it in the wrong way? If you were in my situation what would you change?

 

Now, at firefox I see this: paranormal2.png

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.