RE: [PHP] session code in class problem

From: Date: Thu, 20 Jun 2002 16:26:10 +0000
Subject: RE: [PHP] session code in class problem
Groups: php.general 
Request: Send a blank email to php-general+get-103164@lists.php.net to get a copy of this message
> -----Original Message----- > From: Mark Colvin [mailto:mark.colvin@ccmltd.co.uk] > Sent: 20 June 2002 16:48 > > I have the following .php script and .inc file which doesn't work: > ===== .inc file ===== > > <?PHP > class Sessions > { > > function Check_Session() > > session_start(); > if (!session_is_registered("SESSION")) > { > header("Location: > http://???.???.??.?/index.php?logintext=Please > login."); > exit(); > } > > } > Parse error: parse error, expecting `'{'' in > /var/www/html/includefiles/session_functions.inc on line 7 Quite right. The body of a function needs to be enclosed in { }, so PHP is expecting a { immediately after "function Check_Session()". Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.ford@lmu.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

« previous php.general (#103164) next »