X
X10
Guest
Hello all,
I was hoping someone here could help me identify issues I'm having using the include statement and loading of pages.
Here is the basic version of the code & files that I have:
index.php:
<html><head>
<title>My Main Page
</title></head>
<body>
<table>
<?php include "header.php";?>
<table>
<tr>
<td bgcolor="#FF3311" width="20%">Navigation
<?php include "nav.php"; ?>
</td>
<td width="80%"> Content of page goes here:
<?php if($action != null) { include "$action.php"; } else { include "indexcontent.html"; }?>
</td>
</tr>
</table>
</body></html>
nav.php
<a href="index.php?action=test1">
opens test1.php page
</a>
<a href="index.php?action=test2">
opens test2.php page
</a>
with lots of links like that
header.php
<tr>
<td>
</td>
</tr>
indexcontent.html and test1/2.php can be assumed to have any old rubbish in them, lets say they just contain text for now.
With my code, which is, granted, much longer than this example, but syntactically the same, the header will stay no matter what you do, it will not reload, but whenever you click a link in the nav it reloads the nav section and loads the page into the content section.
What I want it to do is just load the content in the content part of the page and keep the Header & Nav static.
NOTE: What is interesting, just putting this code in as is onto the site, *appears* to work as desired. So I don't know why my code seems to reload the Nav section.
If anyone could help me I would really appreciate it.
X10
I was hoping someone here could help me identify issues I'm having using the include statement and loading of pages.
Here is the basic version of the code & files that I have:
index.php:
<html><head>
<title>My Main Page
</title></head>
<body>
<table>
<?php include "header.php";?>
<table>
<tr>
<td bgcolor="#FF3311" width="20%">Navigation
<?php include "nav.php"; ?>
</td>
<td width="80%"> Content of page goes here:
<?php if($action != null) { include "$action.php"; } else { include "indexcontent.html"; }?>
</td>
</tr>
</table>
</body></html>
nav.php
<a href="index.php?action=test1">
opens test1.php page
</a>
<a href="index.php?action=test2">
opens test2.php page
</a>
with lots of links like that
header.php
<tr>
<td>

</td>
</tr>
indexcontent.html and test1/2.php can be assumed to have any old rubbish in them, lets say they just contain text for now.
With my code, which is, granted, much longer than this example, but syntactically the same, the header will stay no matter what you do, it will not reload, but whenever you click a link in the nav it reloads the nav section and loads the page into the content section.
What I want it to do is just load the content in the content part of the page and keep the Header & Nav static.
NOTE: What is interesting, just putting this code in as is onto the site, *appears* to work as desired. So I don't know why my code seems to reload the Nav section.
If anyone could help me I would really appreciate it.
X10