jowdilla Posted January 29, 2012 Share Posted January 29, 2012 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 : 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: What's wrong with that? Later on, I'll show you what should it look like... like this (with the menu, of course): 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: I really apreciate if you guys help me on this. Many thanks in advance, Peace. Jow Quote Link to comment https://forums.phpfreaks.com/topic/255985-php-include-function-need-some-help-here/ Share on other sites More sharing options...
AyKay47 Posted January 29, 2012 Share Posted January 29, 2012 from the code given, you are injecting an entire php page into a <td> of another php page. This makes no sense. what is your logic? Quote Link to comment https://forums.phpfreaks.com/topic/255985-php-include-function-need-some-help-here/#findComment-1312226 Share on other sites More sharing options...
jowdilla Posted January 29, 2012 Author Share Posted January 29, 2012 Instead of you telling me that Im in a non sense situation, why don't you tell me whats wrong and what to do differently... I think Im in the PHP HELP forum! Quote Link to comment https://forums.phpfreaks.com/topic/255985-php-include-function-need-some-help-here/#findComment-1312230 Share on other sites More sharing options...
jowdilla Posted January 29, 2012 Author Share Posted January 29, 2012 Im not ejecting an entire php page, im just trying to put my menu in my main(index) page, <?PHP include "menu_principal.php" ?> . Quote Link to comment https://forums.phpfreaks.com/topic/255985-php-include-function-need-some-help-here/#findComment-1312232 Share on other sites More sharing options...
AltarofScience Posted January 29, 2012 Share Posted January 29, 2012 <html> <head> </head> <body> <?php include('filename.php'); ?> //example code for a table, table will align under the menu. you may have to change the CSS for the page because includes mess up the flow <table border=1> <tr> <td></td> </tr> </table> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/255985-php-include-function-need-some-help-here/#findComment-1312234 Share on other sites More sharing options...
AyKay47 Posted January 29, 2012 Share Posted January 29, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/255985-php-include-function-need-some-help-here/#findComment-1312236 Share on other sites More sharing options...
jowdilla Posted January 29, 2012 Author Share Posted January 29, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/255985-php-include-function-need-some-help-here/#findComment-1312237 Share on other sites More sharing options...
jowdilla Posted January 29, 2012 Author Share Posted January 29, 2012 Thanks AyKay47, let me try that. Quote Link to comment https://forums.phpfreaks.com/topic/255985-php-include-function-need-some-help-here/#findComment-1312238 Share on other sites More sharing options...
jowdilla Posted January 29, 2012 Author Share Posted January 29, 2012 AK47, after it I got this Quote Link to comment https://forums.phpfreaks.com/topic/255985-php-include-function-need-some-help-here/#findComment-1312240 Share on other sites More sharing options...
AyKay47 Posted January 29, 2012 Share Posted January 29, 2012 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? Quote Link to comment https://forums.phpfreaks.com/topic/255985-php-include-function-need-some-help-here/#findComment-1312243 Share on other sites More sharing options...
jowdilla Posted January 29, 2012 Author Share Posted January 29, 2012 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: Quote Link to comment https://forums.phpfreaks.com/topic/255985-php-include-function-need-some-help-here/#findComment-1312244 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.