TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Programing Languages > PHP

Notices

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

PHP


Reply
 
Thread Tools Display Modes
Old 08-12-2007, 07:01 AM   #1
adam.timberlake@gmail.com
Guest
 
Posts: n/a
I am stuck: Error on a line that begins with the word "const" !!

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:

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.
  Reply With Quote
Old 08-12-2007, 07:01 AM   #2
macca
Guest
 
Posts: n/a
Re: I am stuck: Error on a line that begins with the word "const" !!


> My server is CentOS 4 or 5, I forget which, running PHP 4.1.0 with...




You are trying to use a class constant ("const"). It seems like you
are trying to do some OOP (Object Oriented Programming), i don't think
"const" was not introduced into the PHP OOP model until php5.

Either replace "const" with define('const_name','value') or update
your php version to php5.
  Reply With Quote
Reply

Thread Tools
Display Modes



< Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 04:01 AM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2009, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional