Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2006
    Thanked 0 Times in 0 Posts

    Anyone know a good tutorial for a shopping cart without a database?

    I've just started learning php and I need a shopping cart which doesn't rely on a database. I can't find any tutorials where this is the case. I'm going to learn it with a database soon, but the site I am doing at the moment doesn't need it.

    Basically there are a few things which will be made once sold, so don't require a db. All i need really is a php page which stores whatever is sent to it via a link. So it doesn't even have to be a shopping cart!

    Can anyone point me in the right direction?

    Last edited by Flic; 11-24-2006 at 08:16 PM.

  2. #2
    New Coder
    Join Date
    Aug 2006
    Thanked 0 Times in 0 Posts
    you should learn how to use a database. It's actually easy to do stuff with that then without a database. That's why they are there

    The closest thing I can think of is store things in the link.
    i.e. index.php?a=x

    would store the value x in a. So, use $_GET['a'] to get the value of x, whether you need it. To add more values, just rewrite the link.

  3. #3
    Super Moderator
    Join Date
    May 2002
    Perth Australia
    Thanked 110 Times in 108 Posts
    store the purchases in a session ..e.g.
    PHP Code:
    that way you dont have to keep passing the variables around.. remember to use session_start(); on any pages that need access to the data.

    you can even store the session data for later use ...

    PHP Code:
    /*save it*/
    $save serialize($_SESSION['CART']);

    /*reopen it*/
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts