2 php4 to php5 class errors... REP for help! :D

Discussion in 'PHP' started by MarcL, Apr 17, 2011.

  1. #1
    When upgrading from PHP4 to PHP5 using this script:
    http://net.tutsplus.com/tutorials/php/build-an-ajax-powered-shopping-cart/

    Step 3 – The Shopping_Cart class:
    class Shopping_Cart { 
    PHP:
    Fatal error: Cannot redeclare class Shopping_Cart in shopping_cart.class.php on line 3

    Step 7 - Processing the cart
    foreach ( $_GET['quantity'] as $order_code=>$quantity ) {
    PHP:
    Warning: Invalid argument supplied for foreach() in cart_action.php on line 13

    Will rep, thanks!
     
    MarcL, Apr 17, 2011 IP
  2. MarcL

    MarcL Notable Member

    Messages:
    4,265
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    215
    #2
    Anyone have an idea?
     
    MarcL, Apr 28, 2011 IP
  3. lioncub5

    lioncub5 Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i think using an open source tutorial shopping cart is a great way for you to get hacked
     
    lioncub5, Apr 30, 2011 IP
  4. MarcL

    MarcL Notable Member

    Messages:
    4,265
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    215
    #4
    What should I protect from? I might just end up rewriting it..
     
    MarcL, May 23, 2011 IP