Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About dmx1

  • Rank

Recent Profile Visitors

655 profile views
  1. Thanks Larry! It sounds like a very tall order, especially for a newbie like myself, but I will definitely give it a go!! No doubt, I will run into problems where I will need your help, but I will exhaust every option before requesting your help! Thanks again!!
  2. Hi Larry, Hope you are well. Regarding the 1st edition of your ecommerce book: I am using the non coffee products concept(on page 198) in my own application because I want the user to be able to see a list of different products like on page 198, figure 8.6, when they choose a particular category. But what I want is for there to be a dropdown next to each individual product , like on page 219, (figure 8.15), that lists the different sizes available for each individual product, and everytime the user selects a different size, the price changes accordingly for that individual product. So basically, if we look at your application for example, when the user selects the 'GOODIES' tab, then selects the Mugs option, they are presented with a list of diffent Mugs they can buy, ie, 'Red Dragon', and 'Pretty Flower Coffee Mug'. Say now that each mug come in small, medium and Large sizes. i) would like for there to be a select dropdown next to each Mug option, that displays the different sizes available, just like in the coffee section, but I would like, when the user selects an option, say the large option for a mug, the price for the large mug will change accordingly, and thus be displayed alongside it, similarly an automatic price change for the small and medium mug options also. ii)I would also like to create a product_details page, so when the user clicks on say the 'Red Dragon Mug', they will be taken to a dedicated page that displays more details about the particular mug, giving them the option to add the mug to the shopping cart. iii) When the user goes to the shopping cart, I would like the size of the product to be displayed alongside each item, so the user can see exactly what size item they are purchasing. Please could you help me in achieving the three tasks above, because I have really tried, but I keep getting my code wrong. I'm still in the learning process, so I don't have enough knowledge and experience to implement exactly what I want. So I would really appreciate your help. Thank you!
  3. Hi Larry, In the first edition on page 334, there is a query: $q = '(SELECT CONCAT("O", ncp.id) AS sku, ncc.category, ncp.name, ncp.price, ncp.stock FROM non_coffee_products AS ncp INNER JOIN non_coffee_categories AS ncc ON ncc.id=ncp.non_coffee_category_id ORDER BY category, name) UNION (SELECT CONCAT("C", sc.id), gc.category, CONCAT_WS(" - ", s.size, sc.caf_decaf, sc.ground_whole), sc.price, sc.stock FROM specific_coffees AS sc INNER JOIN sizes AS s ON s.id=sc.size_id INNER JOIN general_coffees AS gc ON gc.id=sc.general_coffee_id ORDER BY sc.general_coffee_id, sc.size, sc.caf_decaf, sc.ground_whole)'; Now when I run this query, I get an error in my application. When I run the above query in phpmyadmin, it says that: 'Unknown column 'sc.size' in order clause' 1)There is not a 'size' column in the 'specific_coffees' (sc), table. So is 'sc.size' in the order clause, in the above query, a typo error? 2)If it is a typo, what should it be instead of 'sc.size'? regards
  4. Hi Larry, I've managed to sort the problem out now! It was really tricky because the files you used are years old, and I was using the current zend framework files, which didn't correspond to the code in your book. That's why I was having problems. I've reached the final.php page now. regards
  5. Hi Larry, I have a few questions for you regarding the zend mail installation. 1) Are there any step by step instructions on how to install the correct zend framework version that you use in the first edition of your book 2) Could you tell me what version of the zend framework you used in the first edition of the book. 3) Could you provide the link to the version you used in the first edition of the book so I can copy the correct files. 4) I downloaded the composer file and the zend framework 3, but the files don't seem to correspond to the code in the email_receipt.php page. That's why I think I have a different zend framework version from the one you downloaded. 5) I can't seem to find the location for: include ('Zend/Mail.php'); in zend framework 3 6) When you create the following line: $mail = new Zend_Mail(); what class are you referring to regarding the object creation, and where can it be located please. Thanks
  6. Hi Larry, I've sorted the problem now. Thanks
  7. Hi Larry, I have managed to get all the way, error free up to the billing.php page. When I get to the billing.php page and put in the values on page 306, and then try to process paymnet, I get an error saying: An error occurred in script '/Applications/MAMP/htdocs/billing.php' on line 161: Undefined offset: 3 The line it is referring to is in the billing.php page which is: $reason = addslashes($response_array[3]); I am not sure, but I think it may have something to do with the gateway_process.php page. When I debugged the file, I get an empty string, "" returned when I execute: $response = curl_exec($request); This line is located in the gateway_process.php page. I replaced all the https, with http, because I don't have an SSL certificate insalled yet. Can you help me fix the problem please. Thanks
  8. Hi Larry, I've got to say, I'm slowly losing patience with what I am trying to do. I have tried everything, and when I think I have solved it, the solved problem generates a new error! In the 'config.inc.php' file, the session_start() method is proving to be a problem. If I comment it out, then the login status is lost, when I go from page to page, which is not what I want. If I include it, the login stats works fine, but everytime I go back to the cart page from the checkout page by clicking the page back button, the url: http://localhost:8888/cart.php?action=add&sku=C11 is generated again, and whatever product is in the shopping cart, is increment by one, so if I have 1 item in the shopping cart, by clicking the back button from the checkout page, which takes me back to the cart page, the above url is sent back, and another item is added, so i would now have 2 items, which is not what I want. I want the same number of items to be in the shopping cart. So by clicking the browser back button from the checkout page, the url I should and want to get is: http://localhost:8888/cart.php and not the first url. This would mean that no extra items would be added in the shopping cart. I have tried everything possible, but I have literally run out of ideas. Qu: Can you please help me resolve the above problems please, because I'm really tired and fresh out of ideas. regards
  9. Hi Larry, To avoid the error: 'Cannot change session id when session is active.' when trying to navigating to the checkout page, you suggested I make every page call session_start() once? How would I make every page call session_start() once? I tried to use: if( session_id($uid)) { session_start(); } but the above method loses login status when I try to navigate to any random pages, just after I log in. regards
  10. Larry, before I saw your reply, I kinda found a way around the error message 'Cannot change session id when session is active' . when I navigate to the checkout page. What I did is put in the checkout page around the problematic line: if(!isset($_SESSION) { session_id($uid); ................................... } So this worked perfectly because the code session_id($uid); would only execute if no session had started. So now I can leave the session_start() method in the configuration file without any conflict when the checkout page is run. Please let me know if my above logic makes sense. regards
  11. Hi Larry, I think I have managed to sort out the problem regarding the the login status being lost when I go to the checkout page. Basically, I implemented the login functionality from the 1st project into the ecommerce site. Now in the config file for the 1st project, it contains the session_start() methhod. This starts the session and tracks logged in users. Now when I go to the checkout page, an error is generated on the following line: session_id(uid); The error says: 'Cannot change session id when session is active.' So because the session has already been started in the configuration file(from the 1st project), when it reaches the statement 'session_id(uid)' in the checkout page, an error is generated because the session is not supposed to be active at that point, but it is, because it's been started in the configuration file to track logged in users. To get around this error, I inserted a session_destroy() method in the checkout page just before session_id(uid); ie: session_destroy(); session_id(uid); and making it the first statement also in the checkout page in the else clause. } else { session_destroy(); session_start(); $uid = session_id This solves the problem, and I can now click on the checkout page without the error, 'Cannot change session id when session is active.' being generated. But the implication now is that, because session_destroy() destroys the session, the user's status is also affected, and hence the user being logged off. In regards to the 1st project, a session_start() method needs to be inserted in the configuration file in order to be available to all the pages, and to track the logged in user. But this is the line that is conflicting with the checkout page and generating an error, hence the session_destroy() being implemented to solve the problem. So I'm in a catch 22 situation now. The session_destroy() method solves one problem, but creates another, ie logs out the user. Qu 1: What solution can I implement to solve the above problem which will allow me to go to the checkout page without losing the login status, whilst allowing the session_start() method in the configuration file to track the logged in users? I find that when I comment out the session_destroy() methods in the checkout page and leave the session_start() method in the configuration file. I now navigate to the checkout page, and then by clicking the back button to go back to the cart page, this inadvertently increments the items in the shopping cart by 1. This is because the url: http://localhost:8888/cart.php?action=add&sku=C11 is being generated each time I go from the checkout page back to the cart page, I think!! Qu 2: What could I do to avoid this issue, so that the items in the shopping cart will remain constant and not be incremented each time I go from the checkout page back to the cart page? regards
  12. Hi Larry, The logged in status is lost when I press the back button to return from the checkout page to the cart page. 1) The cart page doesn't begin with https(but the checkout page begins with https), the cart page is just a normal http page I believe. So wouldn't the problem still exist, because I can't turn the cart page from http to https when it's supposed to be a normal http page. 2) I removed all the https and replaced them with http(for testing purposes), so I shouldn't be having the problem of losing status because I'm going from http to http, for the time being. Qu 1: If my above logic is correct, how would I resolve the issue of not losing the logged in status by travelling from the cart(http page) to checkout page(https page)? regards
  13. Hi Larry, I have managed to find a way to integrate your login form from the 1st section, with the ecommerce site in the second section, which seems to work ok, but there is a slight problem. Everytime I log in, then add items to the cart, then go to the chekcout page, if I decide I don't want to make a purchase at that point, and want to go back and browse more items, I am suddenly logged off. So basically, after logging in, everytime I go to the checkout page from the cart page, and then press the back link to go back to the carts page, I am automatically logged off, then I have to log back in again. So the current session and user credentials gets destroyed everytime I go to the checkout page, and I am then logged off. My question is: Qu 1: Is there a way that I can remain logged in after going to the checkout page, and then clicking the back button to go back to the cart page? Qu 2: Is there a way that I can remain logged in say for 15 minutes with no activity, and then automatically log out if the user hasn't reacted after 15 minutes? regards
  14. Hi Larry, I managed to solve the problem. The problem is when I integrate your login form with the ecommerce site, there is a conflict of code.
  15. Hi Larry, It seems it might have been a cache problem. I deleted the cache for my firefox browser. When I click the link in the 'cart' page to go to the 'checkout' page, I get an error saying: 'Cannot change session id when session is active Array' It is referring to the checkout.php page, and the line that is giving me the error is: // Use the existing user ID: session_id($uid); So I think by emptying the cache, I somehow deleted the cookies etc. Qu: Do you know how i would solve the above problem? regards
  • Create New...