Forum Moderators: coopster

Message Too Old, No Replies

Shoppin Cart Script

         

aanton05

3:59 am on Nov 28, 2005 (gmt 0)

10+ Year Member



Could somebody please tell me why i am getting the following error message? Thanks.

The following is the error message i am getting:

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/qhesiruh/public_html/shoppingcart/cart.php on line 79

Here is my source code:

<snipped code dump, please see Posting Guidelines [webmasterworld.com]>

[edited by: coopster at 10:58 pm (utc) on Nov. 28, 2005]
[edit reason] Removed unnecessary code [/edit]

Steerpike

4:37 am on Nov 28, 2005 (gmt 0)

10+ Year Member



I may be right off here, but I have a feeling that your instansiation of the shopping cart on line 8 needs to be:
$cart = &new ShoppingCart();

If line 79 is the first call to $cart; then it could conceivably generate an error if the cart class hasn't ben created.

(By the way, what exactly does the & in front of new do? I'e seen it before but never with any indication of what it does.)

coopster

10:55 pm on Nov 28, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, aanton05.

You have your quotation marks mismatched on line 73. Change that last single quotation mark to a double quotation mark:

"<a href = \"cart.php\">No</a></center>";

Steerpike, that is called a reference [php.net].