|
-
Nov 5th, 2007, 05:49 AM
#1
Thread Starter
Hyperactive Member
PHP Parse error: syntax error, unexpected T_STRING
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
-
Nov 5th, 2007, 05:53 AM
#2
Re: PHP Parse error: syntax error, unexpected T_STRING
-
Nov 5th, 2007, 08:03 AM
#3
Thread Starter
Hyperactive Member
Re: PHP Parse error: syntax error, unexpected T_STRING
Here it is: -
Code:
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.
-
Nov 5th, 2007, 08:16 AM
#4
Addicted Member
Re: PHP Parse error: syntax error, unexpected T_STRING
Can you do that with a defined variable?
Last edited by Jaquio; Nov 5th, 2007 at 08:23 AM.
-
Nov 5th, 2007, 08:25 AM
#5
Re: PHP Parse error: syntax error, unexpected T_STRING
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.
-
Nov 5th, 2007, 08:29 AM
#6
Thread Starter
Hyperactive Member
Re: PHP Parse error: syntax error, unexpected T_STRING
Okay Thanks, I willwork on that . Cheers
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|