r_honey Posted June 18, 2007 Share Posted June 18, 2007 I wrote some sample PHP code, & tested it thoroughly on my local machine, before uploading it to the server. It worked fine locally, but gave the following error when uploaded: Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in layout.php on line 5 The line 5 referenced by the above error is the Stylesheet line in the following code: class layout { private $Stylesheet = "/style/layout.css"; public $ImagePath = "/images"; More code below... Can anyone help me find out the problem with the above code??? Link to comment https://forums.phpfreaks.com/topic/56052-parse-error/ Share on other sites More sharing options...
per1os Posted June 18, 2007 Share Posted June 18, 2007 How about post the whole code inside the [ code ] tags. ??? You are using PHP 5 right? Link to comment https://forums.phpfreaks.com/topic/56052-parse-error/#findComment-276873 Share on other sites More sharing options...
r_honey Posted June 18, 2007 Author Share Posted June 18, 2007 Yes, PHP5... And what's those [ code ] tags??? I haven't heard about them ??? Link to comment https://forums.phpfreaks.com/topic/56052-parse-error/#findComment-276892 Share on other sites More sharing options...
per1os Posted June 18, 2007 Share Posted June 18, 2007 Post your code in between the [ code ] and [ /code ] tags (minus the extra spaces) That way the code looks like this: <?php //Your script here. ?> Link to comment https://forums.phpfreaks.com/topic/56052-parse-error/#findComment-276957 Share on other sites More sharing options...
KrisNz Posted June 19, 2007 Share Posted June 19, 2007 You might have php5 running locally but since the error says expecting T_VAR ie (var $Stylesheet = "/style/layout.css" your hosted server is running php4. Link to comment https://forums.phpfreaks.com/topic/56052-parse-error/#findComment-277460 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.