PHP Include problem
-
Hey everyone, this is my first post, been trying to find a solution to this problem for couple days now, but no luck so far. I got this to work on a site I worked on a long time ago, but have since forgot how I did it unfortanetly. My problem is I have a top_inc.php which holds the header menu as well as the left side content. The problem is when I include this into my index.php, it causes anything I enter into the html on this page to be pushed below the side left content which is in the top_inc.php. I'm new in this industry and any suggestions are greatly appreciated. Thanks in advance. http://www.hewittmediasolutions.com/sn/index.php for referance.
-
Hey everyone, this is my first post, been trying to find a solution to this problem for couple days now, but no luck so far. I got this to work on a site I worked on a long time ago, but have since forgot how I did it unfortanetly. My problem is I have a top_inc.php which holds the header menu as well as the left side content. The problem is when I include this into my index.php, it causes anything I enter into the html on this page to be pushed below the side left content which is in the top_inc.php. I'm new in this industry and any suggestions are greatly appreciated. Thanks in advance. http://www.hewittmediasolutions.com/sn/index.php for referance.
Hi dhewitt88 and welcome to CP. I don't understand your meaning well, can you post your snippet code .
-
Hi dhewitt88 and welcome to CP. I don't understand your meaning well, can you post your snippet code .
this is the index.php, I typed in hello just for testing ------------------------- Welcome to Stork News!
hello
------------------------- this is the top_inc.php that is for the php include (i took out the mapping to reduce the code length): -------------------------
-
this is the index.php, I typed in hello just for testing ------------------------- Welcome to Stork News!
hello
------------------------- this is the top_inc.php that is for the php include (i took out the mapping to reduce the code length): -------------------------
You should write something like this : Index.php
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to Stork News!</title>
<?php
include ("top_inc.php" ) ;
?>
</head>
<body>
<table align="right" width="841">
<tr>
<td>hello</td>
</tr>
</table>
</body>
</html>top_inc.php
<table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><img src="images/header_banner.gif" width="1024" height="159" border="0" usemap="#Map" />
</tr>
<tr>
<td><img src="images/babiesrus.gif" width="182" height="123" border="0" usemap="#Map2" />
</tr>
</td>
<tr>
<td><img src="images/left_2.gif" width="182" height="122" />
</tr>
</td>
<tr>
<td><img src="images/left_3.gif" width="182" height="123" />
</tr>
</td>
<tr>
<td><img src="images/left_4.gif" width="182" height="122" />
</tr>
</td>
<tr>
<td><img src="images/left_bottom.gif" width="182" height="123" />
</tr>
</td>
</table> -
You should write something like this : Index.php
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to Stork News!</title>
<?php
include ("top_inc.php" ) ;
?>
</head>
<body>
<table align="right" width="841">
<tr>
<td>hello</td>
</tr>
</table>
</body>
</html>top_inc.php
<table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><img src="images/header_banner.gif" width="1024" height="159" border="0" usemap="#Map" />
</tr>
<tr>
<td><img src="images/babiesrus.gif" width="182" height="123" border="0" usemap="#Map2" />
</tr>
</td>
<tr>
<td><img src="images/left_2.gif" width="182" height="122" />
</tr>
</td>
<tr>
<td><img src="images/left_3.gif" width="182" height="123" />
</tr>
</td>
<tr>
<td><img src="images/left_4.gif" width="182" height="122" />
</tr>
</td>
<tr>
<td><img src="images/left_bottom.gif" width="182" height="123" />
</tr>
</td>
</table>I changed the files accordingly and uploaded them to the server. I'm still having the problem where the html from the index.php
hello
is showing up below the include file. you can see the problem at http://www.hewittmediasolutions.com/sn/index.php thanks for the help btw
-
I changed the files accordingly and uploaded them to the server. I'm still having the problem where the html from the index.php
hello
is showing up below the include file. you can see the problem at http://www.hewittmediasolutions.com/sn/index.php thanks for the help btw
I couldn't see your web page. it doesn't show ( why ? ) try this :
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to Stork News!</title>
</head>
<body>
<?php include ("top_inc.php" ); ?>
<table align="right" width="841">
<tr>
<td>hello</td>
</tr>
</table>
</body>
</html> -
I couldn't see your web page. it doesn't show ( why ? ) try this :
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to Stork News!</title>
</head>
<body>
<?php include ("top_inc.php" ); ?>
<table align="right" width="841">
<tr>
<td>hello</td>
</tr>
</table>
</body>
</html> -
hmm, tried that and it didn't work :(, wonder why the page won't show up for you, maybe I linked it incorrectly. http://www.hewittmediasolutions.com/sn/index.php[^] that should work
Atm you have 2 tables ... one with a width of 1024 and right after a table with 100% width ... so you need to do something like this: <table width="1024" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" colspan="2"><img src="images/header_banner.gif" width="1024" height="159" border="0" /> </td> </tr> <tr> <td width="182"><img src="images/babiesrus.gif" width="182" height="123" border="0" /> <td rowspan="5"><?php include("that_header_file");?></td> </tr> </td> <tr><td><img src="images/left_2.gif" width="182" height="122" /> </tr> </td> <tr><td><img src="images/left_3.gif" width="182" height="123" /> </tr> </td> <tr><td><img src="images/left_4.gif" width="182" height="122" /> </tr> </td> <tr><td><img src="images/left_bottom.gif" width="182" height="123" /> </tr> </td> </table> </body> </html>
modified on Saturday, November 8, 2008 9:35 PM