I am trying to use a function to display a web page but am getting problems..
I have contact.php where i have the include:
include("{$_SERVER['SERVER_NAME']}/includes/displaypagefunction.php");
then under my switch case default i call the function, however, this does not work... get a php error. I know its this line because when I take it out it compiles ok.
default:
displaypage("contactform.php","2.php","3.php");
break;
essentially what I want is the displaypage function to have a html template in it and then each variable to be an include file.
Below is the function html idea.. | and - are the table with the above as includes
| Title Include |
| contactform.php | 2.php |
| -------------------- |_______|
| -------------------- | 3.php |
here is part of the dispalpage function
function displaypage($body,$sidetop,$sidebottom)
{
global $info;
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">
<?php
include("{$SERVER['SERVER_NAME']}/includes/title.php");
?>
</td>
</tr>
<tr>
<td colspan="2">
<?php
include("{$SERVER['SERVER_NAME']}/includes/navbar.php");
?>
</td>
</tr>
<tr>
<td rowspan="2">
<?php
if($body!="none")
{
include("{$_SERVER['SERVER_NAME']}/includes/'$body'");
}
?>
</td>
any help would be greatly appreciated
Thanks