Hey guys. I have 2 simple classes "NavClass" and "SuccessErrorClass". In the "SuccessErrorClass" I include the navclass and create a new NavClass object. But I am getting this error where I create the new NavClass object.
"Parse error: parse error, expecting T_OLD_FUNCTION' orT_FUNCTION' or T_VAR' or'}'' in ...successerrorclass.php on line 9"
I use the navclass in the exact saem way in other places in the site and it works just fine so I am confused.
Any help is appreciated, thanks!
here are the two classes code
SuccessErrorClass
<?php
include("navclass.php");
class SuccessErrorClass{
$nav = new NavClass();//error occurs here
function ErrorMessage($msg){
?>
<td valign=top>
<br>
<p><b>Error: <?php echo $msg; ?></b><br>
If this error persists please write us an email by <a href="mailto:name@yourdomain.com">clicking here</a>
</td>
<?php
$nav->Footer();
exit();
}//end ErrorMessage
function SuccessMessage($msg,$forward, $forwardWhere) {
?>
<td valign="top">
<br>
<p><b>Success:</b> <?php echo $msg; ?>
<br>
<br>
Your are now being forwarded <a href="<?php echo $forward; ?>"><u><font color="#406766"><b><?php echo $forwardWhere; ?></b></font></u></a> If you are not transferred please click <a href="<?php echo $forward; ?>"><u><font color="#406766"><b>here</b></font></u></a>
<META HTTP-EQUIV="refresh" CONTENT="3; URL=<?php echo $forward; ?>">
</td>
<?php
$nav->Footer();
}//end SuccessMessage
}//end class SuccessError
?>
NavClass
<?php
class NavClass{
function TopNav(){
require_once("topnav.php");
}//end TopNav
function SideNav() {
require_once("sidenav.php");
}//end SideNav
function Footer() {
require_once("footer.php");
}//end SideNav
}//end class NavClass
?>