Spring Posted December 14, 2010 Share Posted December 14, 2010 This is my first class, go easy on me. <?php session_start(); class Train { private $_clicked; private $_name; function __construct() { $this->_name = $_SESSION['name']; $this->_clicked = $_SESSION['clicked']; } public function CheckLogged() { $this->_name == true ? "" : die("You must be logged in!)"; } public function CheckClicked() { if(isset($_POST['go'])) { $this->MysqlUpdate(); $this->_clicked = 1; } } public function Clicked() { if(isset($this->_clicked)) { echo' <div id="train"><img src="images/train.jpg" alt="train image"/></div> <div id="text"> <span id="click">' . ucfirst($this->name). ' has gained 7 experience,<br /> and cannot train anymore today. </span><form method ="post" name="train" action=""> </div>'; } else { echo' <div id="train"><img src="images/train.jpg" alt="train image"/></div> <div id="text"><span id="click">Click here to train your shinobi!</span> <form method ="post" name="train" action=""><input type="submit" name="go" value="train" /></div>';} } private function MysqlUpdate() { $query = "UPDATE account_info SET experience = experience + 7 WHERE username = '$this->name'"; $result = mysql_query($query) or die(mysql_error()); } } ?> getting this error Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home2/producy2/public_html/arzania/train.class.php on line 6 Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 14, 2010 Share Posted December 14, 2010 You are still using php4. The end of life of php4 was nearly 4 years ago. Time to upgrade. Quote Link to comment Share on other sites More sharing options...
Spring Posted December 14, 2010 Author Share Posted December 14, 2010 You are still using php4. The end of life of php4 was nearly 4 years ago. Time to upgrade. It's my host, how can I make them private with php4? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 14, 2010 Share Posted December 14, 2010 You can't. Your host should have provided a way of upgrading your account to php5, either through a control panel choice or through a setting in a .htaccess file. Quote Link to comment Share on other sites More sharing options...
Spring Posted December 14, 2010 Author Share Posted December 14, 2010 You can't. Your host should have provided a way of upgrading your account to php5, either through a control panel choice or through a setting in a .htaccess file. Ok thanks, I'll open a ticket. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.