Jump to content
Killersites Forums

cabey84

Member
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About cabey84

  • Rank
    New member
  1. Hi there, I am trying to create a multipart form where a user logs in, then fills out their information, uploads a document, and then are led to a shopping cart. I have already created the shopping cart, but need help with the first 3 steps and how to basically link them together. Can anyone offer any books and/or tutorials that might be of assistance? Thanks so much.
  2. Problem solved. First of all, I was putting session_start() before the class definitions were uploaded on the page. Secondly, I forgot to serialize the session object after it had been stored in session and unserialized. This was a really good lesson on learning how to store PHP objects in sessions.
  3. Thanks for that suggestion. I tested the source code and I get the same error. Fatal error: Call to a member function AddItem() on a non-object in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\shoppingcart2\html\addToCart.php on line 13 When I delete cookies on my browser, the source code works. Why is this happening?
  4. I am typing the code. I compared it to the source files and my code looks the same. I think it might be a problem related to serialization and storing the object in the session. From the php manual: " It is strongly recommended that you include the class definitions of all such registered objects on all of your pages, even if you do not actually use these classes on all of your pages. If you don't and an object is being unserialized without its class definition being present, it will lose its class association and become an object of class __PHP_Incomplete_Class_Name without any functions
  5. Hi there, Sorry for all the questions. I'm a newbie trying to work my way through the Killer PHP video tutorials and everything was fine until I hit the shopping cart tutorial. The approach that the video tutorial takes is to create a ShoppingCart class and then create a shoppingcart object. I am running into several problems. Step #1- Checking to see if the Session Variable is set. If it is not, then a constructor is used to instantiate an object of ShoppingCart class. If it is set, then it is to return the variable in SESSION. (This value is later serialized.) function get_
  6. Thanks so much for your help. I actually just ended up leaving out the foreach loop altogether and stuck with using an if statement within the while loop because I need to be able to loop through all the products.
  7. Hi, I am going through the PHP Shopping Cart tutorial where xml rather than a mysql database was used to construct the data. I have been trying to adjust the code to fit with the use of the mysql database, but I keep running into some problems. The first one that has me completely stumped is checking to see if the product exists in the database. In the video tutorial, using xml, the code is as follows: function product_exists($product_id) { foreach (get_xml_catalog() as $product) { if ($product->id == $product_id) return true; }
×
×
  • Create New...