2014-02-28 50 views
0

我正在使用Zen Cart構建一個站點,並且已經在.php文件中更改了define()。無論我做了什麼都阻止了該程序的功能,我無法弄清楚原因。什麼導致這個PHP的define()方法不起作用?

我已經消除的唯一元素列表標籤和「強」的標籤。它們對定義常量至關重要嗎?

首先是我的編輯,二是股票方法(我打破了他們,這樣的搜索我的錯誤):

define('EMAIL_TEXT', 'You are now registered with our little buying group and have account privileges on this site.' . "\n\n" . 

'Please remember that you can order as many or as few items as you like but if we as a group do not reach case amounts then we can't bring the item in.' . "\n\n" . 

'Please also remember that produce prices vary day to day and week to week. The prices listed on this site are estimates only. Expect the final cost to reflect these small fluctuations. Before I place an order I will send out a group email that will mention any particularly egregious price hikes.' . "\n\n" . 

'You will need to pick up your items from my house in a timely manner. I can't be held responsible for lettuce wilting in my garage while you're skiing at Liberty all weekend.' . "\n\n" . 

'I'm glad you joined us. The more people we get, the more produce we should be able to order and the more we order the more I can negotiate better pricing.' . "\n\n" . 

'Here's to eating organic!' . "\n\n"); 


define('EMAIL_TEXT', 'You are now registered with our store and have account privileges: With your account, you can now take part in the <strong>various services</strong> we have to offer you. Some of these many services include:' . "\n\n<ul>" . 

'<li><strong>Order History</strong> - View the details of orders you have completed with us.' . "\n\n" . 

'<li><strong>Permanent Cart</strong> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n\n" . 

'<li><strong>Address Book</strong> - We can deliver your products to an address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.' . "\n\n" . 

'<li><strong>Products Reviews</strong> - Share your opinions on our products with other customers.' . "\n\n</ul>"); 
+0

當您連接字符串時,請確保使用引號而不是撇號。所以「。」而不是」。」 – SyntaxLAMP

+0

我只是模仿股票例子,那就是他們有它和它的正常工作......在他們的代碼中,報價僅爲周邊線路中斷。 – MayNotBe

+0

你誤用'定義() 。'你應該不是文本的這樣一個巨大的量存儲在一個常數,一旦你定義它,它會留在內存中,直到腳本結束你可能想使用一個變量,而不是 – Raptor

回答

1

的問題是在下面的行額外的撇號被終止定義初:

'Here's to eating organic 

你需要躲避第二撇號 - 只需將其更改爲:

'Here\'s to... 

編輯:有一些其它的,如:

'I'm... 

應該

'I\'m... 

或者格式化字符串如下,我想你會同意它是更清晰也更小級聯:

"I'm ... \n\n". 
"Here's to organic\n\n". 
... 
+0

你,先生或女士,是我的英雄,我知道它是這樣的,我疲憊的心靈並沒有看到的。謝謝。 – MayNotBe

+0

你是最歡迎的。 – JBES

+0

比ks的格式化字符串的提示。我是PHP和HTML的新手,所以我只是想跟隨股票頁面正在做什麼。 – MayNotBe

相關問題