Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTI

Status
Not open for further replies.

ralphiooo

Programmer
Oct 23, 2005
64
GB
Hi, i'm getting the following error on one of the pages on my site:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/includes/sessions.class.php on line 9

the start of the sessions.class.php is:

Code:
<?php

class session_handler {
	/**
	* __construct() - class constructor
	*
	* @return   void
	*/
	public function __construct() {
		session_handler::set_handler();
	}

	/**
	* set_handler() - sets the session handler
	*
	* @return   void
	*/
	public static function set_handler() {
		session_set_save_handler(array('session_handler', 'open'), array('session_handler', 'close'), array('session_handler', 'read'), array('session_handler', 'write'), array('session_handler', 'destroy'), array('session_handler', 'gc'));
	}

My server uses php 5 so i was getting lots of strict warning messages which i have managed to tweak to get rid off but now i am getting this error message on one of the pages on the site but none of the others. The only difference with this file and the rest is that it has the extension .xml (it is an rss feed) and in my .htaccess file i have AddType application/x-httpd-php .xml .rss to make the server treat the file as a php file.

Appreciate it if someone could help. Thanks
 
r u sure? the pairs look matched to me.

@ralphioo
i get no parse errors with this code. i suspect that your server may have php4 and 5 installed contiguously and your htaccess directive is perhaps shoving the file down the wrong interpreter (or something tantamount).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top