Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Larry

  1. Right, if you're using session_destroy() it's going to destroy the session, which is not what you want. What you want is for every page to call session_start() once. If all pages include the configuration file, that should suffice.
  2. I'm not quite following what you're saying. In point 1 you say the cart is HTTP and the checkout is HTTPS. In point 2 you say they are all HTTP. Could you clarify what the reality is where you're seeing this behavior?
  3. You're probably losing the logged in status b/c you're going back and forth from HTTP to HTTPS. If it's all HTTPS you probably won't have that problem. As for remaining logged in, it depends upon whether you're using cookies or sessions but it's just a matter of extending the duration of whichever accordingly.
  4. Off the top of my head and given the information provided I can't think of an obviously easier way. There's a lot to be said for "this works"!
  5. This may be related to your PHP version. What version are you using?
  6. The key to figuring this out is remember that if multiple radio buttons have the same name, only one can be checked. So just write your code to create the proper names based upon the restriction you want to put in place.
  7. You don't say how it's not working but my guess is the problem is b/c you're hard-coding the PDF application type in there. The content-type header indicates to the browser what type of file to expect. If you say to expect a PDF but send a Word doc, that's not going to work.
  8. So the problem is that you're still viewing an HTTPS page when you don't have HTTPS enabled. I assume it's because of the .htaccess. Did you restart the web server after making the change?
  9. The newline affects the HTML source code of the page. It's visible there, not in the visual result rendered by the browser.
  10. Ah! Then if you haven't acquired a certificate, your HTTPS links won't work. Change them to HTTP. I wouldn't worry about a certificate for now--and certainly don't purchase one yet.
  11. If you're getting a 404, your PHP code is probably fine and it's the Apache configuration that's the problem. In other words, given this URL, Apache doesn't know what page to serve. It looks like your regular expressions are incorrect. You seem to be using the same matching pattern for all three conditions and that pattern doesn't match /our-furniture-test/beds/20/5/.
  12. I don't quite follow why you would print the same database value in three different radio buttons. Radio buttons are normally used to select one item from a group of items with different values. I also wouldn't use array syntax for the radio button name. You'd only want to do that for something like SELECT menus or checkboxes where multiple values can be selected or checked.
  13. First, to be clear, the behavior has nothing to do with DIVs (or PHP for that matter). It's simply how radio buttons work in HTML. I'm not quite following what you're trying to do, though. Maybe you should be using checkboxes instead? If you could explain the scenario in more detail I can give more specific advice.
  14. It's probably either a problem with your certificate or your server configuration. What operating system and web server are you running and how did you install and configure the certificate?
  15. Thanks for the nice words! As for this situation, first of all, congrats on the growth of your site! I've not done this particular thing before, but my inclination is to start by thinking about what variables would exist. You'd always have $current_page and $total_pages. I think I'd then add a $show variable, for the number of additional numbered links to show (e.g., 2 gets you 4 5 6 7 8). Then the logic becomes: If $total_pages is greater than some figure (maybe $show * 4?), don't loop through every page number. And then... If there's more than $show pages between 1 and $current_page, do "FIRST...". And also... If there's more than $show pages between $current_page and $total_pages, do "...LAST" I'm not sure if that's everything but off the top of my head that should get you going in the right direction! Let us know how it goes or if you have more questions!
  16. Thanks for the nice words on the book! I don't quite follow what your goal is here, however. Could you maybe start by explaining the end result you're working towards?
  17. Hey Hector! Thanks for the interest in the book and it's great that you have a target project in mind. The book does cover how to have multiple users with login/logout, so it'll give you the bones of what you want.
  18. Excellent. Kudos for figuring it out and thanks for sharing the solution!
  19. Thanks so much for the nice words. I really appreciate it. Kudos for figuring out the MySQL question! As for the redirect it sounds like you just have a bug in your code somewhere. Find the redirect line and see that you aren't adding an extra "http//" somewhere.
  20. That seems like you're on the right path. I'm not quite following what the problem is. You say it gives you an error when you do 0, but that seems like the correct behavior, no?
  • Create New...