By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,379 Members | 3,035 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,379 IT Pros & Developers. It's quick & easy.

I am stuck: Error on a line that begins with the word "const" !!

P: n/a
Me again! I am trying to create a currency converter function for my
eCommerce that still pet treats. I am a little short on money recently
and so cannot afford a programmer. Can somebody tell me why my script
tells me that I have a syntax error on the "CONST" line. I am trying
to follow the article below.

Article: http://www.talkphp.com/showthread.php?t=1503

The error I get is:

Parse error: parse error, expecting `T_OLD_FUNCTION' or
`T_FUNCTION'...

My server is CentOS 4 or 5, I forget which, running PHP 4.1.0 with
MySQL 5, I think. The line that it shows me the error on is:

const OPT_FILE = 'talkphp_conversion_rates.json';

Please help! Also, somebody mentioned something about cross-posting on
newsgroups so that I can post to more than 1 group in case I do not
get a good answer in 1. Could somebody tell me how to do this with
Google Groups please!!

Thannk you.
Dec 8 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Sat, 08 Dec 2007 01:57:49 +0100, <ad*************@gmail.comwrote:
Me again! I am trying to create a currency converter function for my
eCommerce that still pet treats. I am a little short on money recently
and so cannot afford a programmer. Can somebody tell me why my script
tells me that I have a syntax error on the "CONST" line. I am trying
to follow the article below.

Article: http://www.talkphp.com/showthread.php?t=1503

The error I get is:

Parse error: parse error, expecting `T_OLD_FUNCTION' or
`T_FUNCTION'...

My server is CentOS 4 or 5, I forget which, running PHP 4.1.0 with
MySQL 5, I think. The line that it shows me the error on is:

const OPT_FILE = 'talkphp_conversion_rates.json';
A class 'const' is not possible in PHP4, the same goes for
'private'/'public'/'protected' class variables (they all are public, and
created with the keyword 'var'). Consult the manual for changes between
PHP 4 & PHP 5:
http://nl2.php.net/manual/en/language.oop.php
http://nl2.php.net/manual/en/language.oop5.php

PHP 5 is pretty old now, and stable, so seriously consider upgrading if
you want to do anything with OOP.
--
Rik Wasmus
Dec 8 '07 #2

P: n/a
On Dec 7, 7:57 pm, adam.timberl...@gmail.com wrote:
Me again! I am trying to create a currency converter function for my
eCommerce that still pet treats. I am a little short on money recently
and so cannot afford a programmer. Can somebody tell me why my script
tells me that I have a syntax error on the "CONST" line. I am trying
to follow the article below.

Article:http://www.talkphp.com/showthread.php?t=1503

The error I get is:

Parse error: parse error, expecting `T_OLD_FUNCTION' or
`T_FUNCTION'...

My server is CentOS 4 or 5, I forget which, running PHP 4.1.0 with
MySQL 5, I think. The line that it shows me the error on is:

const OPT_FILE = 'talkphp_conversion_rates.json';

Please help! Also, somebody mentioned something about cross-posting on
newsgroups so that I can post to more than 1 group in case I do not
get a good answer in 1. Could somebody tell me how to do this with
Google Groups please!!

Thannk you.
If upgrading is not an option, you can use define to achieve a similar
thing.
define("OPT_FILE", 'talkphp_conversion_rates.json');
Dec 9 '07 #3

P: n/a
allain wrote:
On Dec 7, 7:57 pm, adam.timberl...@gmail.com wrote:
>Me again! I am trying to create a currency converter function for my
eCommerce that still pet treats. I am a little short on money recently
and so cannot afford a programmer. Can somebody tell me why my script
tells me that I have a syntax error on the "CONST" line. I am trying
to follow the article below.

Article:http://www.talkphp.com/showthread.php?t=1503

The error I get is:

Parse error: parse error, expecting `T_OLD_FUNCTION' or
`T_FUNCTION'...

My server is CentOS 4 or 5, I forget which, running PHP 4.1.0 with
MySQL 5, I think. The line that it shows me the error on is:

const OPT_FILE = 'talkphp_conversion_rates.json';

Please help! Also, somebody mentioned something about cross-posting on
newsgroups so that I can post to more than 1 group in case I do not
get a good answer in 1. Could somebody tell me how to do this with
Google Groups please!!

Thannk you.

If upgrading is not an option, you can use define to achieve a similar
thing.
define("OPT_FILE", 'talkphp_conversion_rates.json');
In this case, upgrading is NOT an option, since PHP4 will go EOL in
about 3 weeks.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Dec 10 '07 #4

P: n/a
Jerry Stuckle wrote:
allain wrote:
>On Dec 7, 7:57 pm, adam.timberl...@gmail.com wrote:
>>Me again! I am trying to create a currency converter function for my
eCommerce that still pet treats. I am a little short on money recently
and so cannot afford a programmer. Can somebody tell me why my script
tells me that I have a syntax error on the "CONST" line. I am trying
to follow the article below.

Article:http://www.talkphp.com/showthread.php?t=1503

The error I get is:

Parse error: parse error, expecting `T_OLD_FUNCTION' or
`T_FUNCTION'...

My server is CentOS 4 or 5, I forget which, running PHP 4.1.0 with
MySQL 5, I think. The line that it shows me the error on is:

const OPT_FILE = 'talkphp_conversion_rates.json';

Please help! Also, somebody mentioned something about cross-posting on
newsgroups so that I can post to more than 1 group in case I do not
get a good answer in 1. Could somebody tell me how to do this with
Google Groups please!!

Thannk you.

If upgrading is not an option, you can use define to achieve a similar
thing.
define("OPT_FILE", 'talkphp_conversion_rates.json');

In this case, upgrading is NOT an option, since PHP4 will go EOL in
about 3 weeks.
I mean, NOT upgrading is NOT an option...

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Dec 10 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.