Hi guys, thankyou for the quick response, much appreciated. And apologies for my late reply i have been working away for 2 days so its been kinda hectic... ok heres some code and an explanation of what i aim to do. Hopefully someone can shed some light as to either where i am going wrong, or a simpler solution....
I have worked out how to change my links depending on which page is being viewed, but i want to include a file only on certain pages within my site. The include file contains a table with text and images on, and the image relates to the page, but not all pages need this include file, only some. 1) is it possible to have an if statement in an include, that is iuncluded inside an if statement?.
heres what i tried to do
My main page code.....
PHP Code:
<td width="646" id="page" align="center">
<br>
<?php if ($sel_page) { ?>
<h2><?php echo $sel_page['menu_name']; ?></h2>
<?php include("game_page.php"); ?>
<div class="page-content">
<?php echo $sel_page['content']; ?><br><br>
<?php echo $sel_page['guide']; ?><br><br>
<?php echo $sel_page['cheat']; ?>
</div>
<?php } else { ?>
<br><br>
<h2> THIS SITE IS CURRENTLY UNDER CONSTRUCTION</h2>
<?php } ?>
</td>
The file i am trying to include is this.....
PHP Code:
<?php include("game_page.php"); ?>
As it is already contained within an if statement, can i use an if statement withing the include? i tried to and the page just went white when loaded up in FF. I am trying to get it to recognise which pages require the included file by using a tinyint in the database giving a 1 or 0 depending on whether it should be used.
Here is the code inside the include file....
PHP Code:
<table width="600" id="title_table">
<tr>
<td>
<table width="300">
<tr>
<td> Genre :
</td>
<td><?php echo $sel_page['genre']; ?></td>
</tr>
<tr>
<td>Play Here :
</td>
<td><a href="<?php echo $sel_page['url']; ?>"><?php echo $sel_page['menu_name']; ?> </a></td>
</tr>
<tr>
<td>Score :
</td>
<td><?php echo $sel_page['score']; ?></td>
</tr></table>
</td>
<td>
<table width="300">
<tr>
<td>
**** I want to place an image here ****
</td>
</tr></table>
</td>
</tr>
</table>
Any help or ideas would be appreciated
thankyou
Dan