My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
MultipleIncludes  
How to use multiple includes on the same page
Updated Apr 8, 2010 by chriswat...@gmail.com

Introduction

In some situations you might want to have multiple includes on the same page. For example have your headlines show on one section and have the news display on another. Below is an example of how to do that.

Examples

In this example we'll use 2 includes for simplicity's sake.

Imagine a page split into 2 columns

<table width="100%" style="borer: 1px solid #000000">
<tr>
<td width="50%">left column</td>
<td width="50%">right column</td>
</tr>
</table>

In the left column we want to show some headlines that when clicked, will open up within the right column. To do that we make the left column static like so

<table width="100%" style="borer: 1px solid #000000">
<tr>
<td width="50%">
<?php
$static = 'true'; #this is the important part
include 'news/index.php';
?>
</td>
<td width="50%">
<?php
include 'news/index.php';
?>
</td>
</tr>
</table>

You can only have 1 include that isn't static. For example if you have 4 includes on the same page, 3 of them have to be static otherwise there'll be problems.

Comment by Chilter...@gmail.com, Jun 17, 2010

this idoesn't work.... it just shows the news in both columns

Comment by pbg...@gmail.com, Sep 5, 2010

yeh


Sign in to add a comment
Powered by Google Project Hosting