|
PHP How-To Post your "How do I do this with PHP?" questions here. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
May 7th, 2006, 06:28 PM
|
Registered User
|
|
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
PHP Parse error: parse error, unexpected T_STRING
I went through the SimpleMail() example in the Wrox PHP5, Apache, MySQL Web Development book and am having a problem. I successfully implemented this on one site but copied the class over to a different one and it won't work. I am getting the following error:
PHP Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}'
Others have asked about this exact error but the only response I've seen is that maybe there is a typo in the code. If this didn't work on a different site, I would think that is a fair comment but since it works elsewhere, that isn't it.
I'd appreciate any help.
Thanks,
Pat
|
May 7th, 2006, 07:05 PM
|
Registered User
|
|
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I found some information that says PHP5 needs to be running and it turns out that PHP Version 4.3.11 is running on the server. I hope this information helps anybody with experiencing the same problem.
|
May 14th, 2006, 05:11 AM
|
Registered User
|
|
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hmm... this is my guess here.. dont take it too seriously..
as you are using php 4.3.11, i would likw you to upgrade your PHP to the latest version and an upto date build.
and in your code just remove the public/private declared functions to simple functions and public variables to simple variable (var).
ie., 'public function lock()' must be changed to 'function lock()' and 'public $amount;' to 'var $amount;'
and dont forget to recheck the set of paranthesis at the end of the code or somewhere in the middle..
I am Still Learning ! please Co-operate With Me :)
|
August 18th, 2007, 02:27 AM
|
Registered User
|
|
Join Date: Aug 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sorry Richard, but this is a typical message about php5 code running on a php 4 server.
So the possibilities are downgrading code, or upgrading server if possible...
|
Similar Threads
|
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
Parse error: syntax error, unexpected T_ELSE in /h |
vipin k varghese |
BOOK: XSLT Programmer's Reference, 2nd Edition |
4 |
September 29th, 2011 01:19 AM |
Ch 4: Parse error: syntax error, unexpected T_SL |
hanizar77 |
BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 |
0 |
June 23rd, 2008 09:17 PM |
Parse error: syntax error, unexpected T_STRING |
ginost7 |
Beginning PHP |
1 |
November 9th, 2007 02:51 AM |
Parse error: parse error, unexpected $end |
Ayodeji Adegbaju |
Pro PHP |
3 |
January 12th, 2007 12:21 PM |
Parse Error unexpected T_IF |
Adam H-W |
Beginning PHP |
2 |
June 9th, 2006 03:37 AM |
|
|