Click to See Complete Forum and Search --> : PHP Parse error: syntax error, unexpected T_STRING
tendemo
Nov 5th, 2007, 04:49 AM
Hi, I am getting the above mentioned error when I change the HTML text from within a PHP define statement. Im a newbie in this feild , may I know what may be causing this error and how it may be avoided.Thanks
penagate
Nov 5th, 2007, 04:53 AM
Post the code please.
tendemo
Nov 5th, 2007, 07:03 AM
Here it is: -
define('STRING_GREETINGS', '<h1>Welcome to My Online Store!</h1>
<p>This online store is powered by <a href="http://www.shop-script.com/php-shopping-cart-software-1.html">
Shop-Script FREE shopping cart software</a>.<br />
Shop-Script FREE is lite PHP shopping cart solution that allows you to create your own online store. Shop-Script FREE comes with fully open source code, and is free to use and modify.
<p>This text is editable.<br />
To edit open file <b>languages/english.php</b> in your text editor (e.g. Notepad).</p>');
Lets say I want to do something like change Welcome to my online store, to Goodbye from my online store, I get this message. However when I restore original code the error disapears.
Jaquio
Nov 5th, 2007, 07:16 AM
Can you do that with a defined variable?
penagate
Nov 5th, 2007, 07:25 AM
Putting HTML into variables is generally a bad idea, as is using echo to output the bulk of the document.
If you have some HTML that is common to several pages, put it in its own file and include() it.
tendemo
Nov 5th, 2007, 07:29 AM
Okay Thanks, I willwork on that . Cheers
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.