sup guys,
im totally new to php and i need some help.
i need help with includes, setting different variables to change certain includes on a page. basically making layers of includes.
basically on the index page i have a table with a menu and code for the include (lets call it layer 1). the menu links are home and roster.
now within the roster page i have a similar situation. within it is a table with a menu and that include code, but with a different variable(layer 2). the links in the roster page are active roster and alumni roster.
when i click the links in the roster page, it goes to the home page(as if i clicked a link on the index page).
how can i make it so that the links in the roster page change the content in it only?
heres the code for the index page
<table width="500" cellpadding=1 border=1 cellspacing=1>
<tr><td>
--menu links are here--
<a href="?z=home">Home</a>
<a href="?z=roster">Roster</a>
</td></tr>
<!-- content -->
<tr><td>
<?php
$id = $HTTP_GET_VARS["z"];
$ext = "php";
if ( !$id || $id == "" )
{ include "home.php";}
else if ( file_exists( "$id.$ext" ) )
{ include "$id.$ext";}
else
{ echo "<center><h2>404 Error: File not found.</h2></center>"; }
?>
</td></tr>
</table>
</td></tr></table>
now heres the code for the roster page
<center><b><font size=5>Roster</font><b><br>
<table width="500" cellpadding="10" border="0" cellspacing="0">
<tr>
<td align=center>
<div><a href="?x=activeroster">Active roster</a> |
<a href="?x=alumniroster">Alumni roster</a>
</div>
</td>
</tr>
<tr><td>
<?php
$id = $HTTP_GET_VARS["x"];
$ext = "php";
if ( !$id || $id == "" )
{ include "default.php";}
else if ( file_exists( "$id.$ext" ) )
{ include "$id.$ext";}
else
{ echo "<center><h2>404 Error: File not found.</h2></center>"; }
?>
</td></tr>
</table>
heres the link to the exact page to view what im talking about.
http://www.berkeleylambdas.com/problem/
if anyone can help me out with this i'd really appreciate it
thanks