Jump to content
Larry Ullman's Book Forums

Larry

Administrators
  • Posts

    5413
  • Joined

  • Last visited

  • Days Won

    155

Everything posted by Larry

  1. Since you've put your files in a subdirectory (if I understand you correctly), you'll need to change the links in the HTML (primarily in the header) to be correct. And you'll need to change the .htaccess file so that it uses a different RewriteBase.
  2. Thanks for the interest in the book. The publisher has just agreed to a third edition of that book, but no deal is in place yet, so it'll be probably a year from now before the third edition is out. If you want to buy the 2nd edition now, I'll go ahead and offer you a free copy of the third edition when it is released.
  3. Thanks for the nice words on the book. Since your site is not in the root directory, you need to change all the links so they begin with /acorn2/html
  4. You're quite welcome. And, actually, I'm glad you've raised this question, because it's what I intended with the book: take what you want from the two examples to make what you need. Thanks, too, for your interest in the JavaScript book. In answer to your question, yes, it's the difference in storage method (or, technically, association method) that would suggest separate tables. In theory you could use the same table for both, with a user_session_id column AND a customer_id columns. For logged-in users, the customer ID gets used. For guests, the user session ID. Proper database design suggests not to have columns with lots of NULL values, which such a table would. But you'll need to slap some logic on the system one way or the other (unless, like Amazon, you insist upon login for wish list manipulation).
  5. Thanks for the nice words. I've read part of this book and can recommend it: http://www.amazon.com/Objects-Patterns-Practice-Experts-Source/dp/143022925X/ref=sr_1_3?s=books&ie=UTF8&qid=1301063737&sr=1-3 I don't know this book, but I've heard excellent things about the author, David Powers: http://www.amazon.com/PHP-Object-Oriented-Solutions-David-Powers/dp/1430210117/ref=sr_1_1?s=books&ie=UTF8&qid=1301063737&sr=1-1 I'm not familiar with this book or the writer, but the publisher puts out good books and it gets good reviews: http://www.amazon.com/Object-Oriented-PHP-Concepts-Techniques-Code/dp/1593270771/ref=sr_1_6?s=books&ie=UTF8&qid=1301063737&sr=1-6 Please let us know if you find a book that you particularly like.
  6. This is just a note to say that I haven't officially created any "Review and Pursue" threads in this forum yet as I didn't know what, exactly, readers would want. So feel free to post your questions as you have them and I'll answer them as they come. In time I may then shuffle things around to create an organized "Review and Pursue" system. Thanks for your interest in the book!
  7. It's not a security risk, it's a caching issue. When you click "back", the browser tries to reload the previously-cached version. To force the page to be reload, you'll need to send "no cache" headers. I don't have the code off the top of my head, but I think it may be on the PHP manual page for the header() function.
  8. If I were you, I'd make a decision about requiring login or not. Because if you want a permanent wish list, that requires login and you would store the customer ID in the wish lists table. If you want non-logged-in users to have a temporary wish list, as in the book, you'd use the cookie. If you want both features, I would use two separate tables, But then there might be issues about transferring non-logged-in wish list items to the other table when the user later logs in. So, it's complicated. As for the HTTP/HTTPS gap, I'm not sure what I was thinking before, but I think you're right: it's just the same issue that's already been overcome.
  9. Filter what dropdownlist? How about showing some code? How about reading and abiding by the forum guidelines?
  10. Thanks for the nice words on the forum (and for posting the pertinent details). I suspect the problem is because you haven't added a FULLTEXT index to the description column. Also, I could totally be wrong about this, but I don't think the % is used in FULLTEXT searches (that's for LIKE).
  11. Thanks for helping, HartleySan. I've got a fix for the bold/code issue: don't use bold within code!
  12. You're welcome. Just let me (i.e., the forum) know when or if you need more help with this.
  13. Okay, so you see that result if this conditional is not true: if (!$type || !$sp_type || !$sp_cat || !$category) { So to debug this, just before that line, I would echo out the values of those four variables.
  14. You're quite welcome. Glad it's working now and thanks for letting me know.
  15. Hey Stuart, Sorry I haven't responded yet. Your post requires a little more time/thought than I have right now, but I'll take a good look at it and get you a reply soon.
  16. Hey Jonathon, So, based upon your postscript, do you still need some help with this or no?
  17. No, you don't want to select the other table there. That query just gets the list of categories. Your edit script should have a separate query that retrieves all the information for the page being edited. That query should also be selecting the page's current category ID. It's this value you would compare to within the loop to determine which row gets pre-selected. Once you get that working, you can then add that code that watches for "stickyness".
  18. Thanks, Jonathon, for helping and thanks to HartleySan for posting the solution.
  19. You can use \t to create tabs in the HTML source, just as you use \n to create newlines. Or you could put the formatting into the PHP code (by using tabs and newlines within the echo statement).
  20. Well, the header and footer and CSS could or could not dictate the layout of the page, depending upon how everything is put together. So you could just create the X columns in the primary file and the header, footer, and CSS are the same. Or you could create one header, footer, and CSS combo for the X column layout and another for the Y column layout. If that's the case, you'd just include the other header, footer, and CSS combo when a different style is needed.
  21. Actually the password should look like neither of those because it should be stored in binary format. It would help to know what versions of PHP and MySQL you're using, per the forum guidelines. Also what did you use to "look" at the database?
  22. Thanks for the nice words on the book and for the specific feedback on the advanced queries. Much appreciated. I'm also glad you felt the book was distinguished from the others (and thanks for the continued interest in my books!). As for your question, you're right on target. However, you don't need to change Carts and Wishlists and user_session_id. You could just store the user_session_id in the customers table each time they log in. Then the other functionality stays the same. You could do what you propose and change the uses of user_session_id to customer_id, but the only real change required to the stored procedures would be that customer_id would be an integer and not a string. However, the trick there is that you'd need to store the customer ID in a cookie (on the public side), which is a bad ID. Or you could store it in a session, which would be better, but then you'd need to use sessions on the public side and visibly pass the session ID to the checkout process (the HTTPS), which isn't ideal. And that's really the trick here: bridging the HTTP/HTTPS gap (because the same cookie isn't available in both). Does that make sense or did I just say a lot without actually answering the question?
  23. Thanks for the nice words. The issue is that PHP is unable to send out the email with the error that occurred. The solution to that depends upon the OS in use, the mail server in use, and the version of PHP in use, none of which do you indicate (per the forum guidelines). You also have a problem in your conditional. It should be if (!$live) The emails should be sent out if the site is live. If the site is not live, the errors should be displayed in the browser.
×
×
  • Create New...