Jump to content
Larry Ullman's Book Forums

Larry

Administrators
  • Posts

    5413
  • Joined

  • Last visited

  • Days Won

    155

Posts posted by Larry

  1. Okay, that's a big question. I'll look into it and see about writing a blog posting explaining how to use PayPal Website Payments Pro for the Coffee site example. Just so you're prepared, it'll probably take me some weeks to do all that. I'll post a link to it here once I've done it.

  2. Well, first of all, the book doesn't do everything, so I expect the reader can take what's there, and add what you want to happen when an error occurs. But the other thing is that the try...catch can handle errors in any block of code. If you went if-else, you'd have to do that for every possible thing. Say you have a block of code that involves five steps. With if-else, you'll need to create if-else statements for each of the five steps. With try...catch, you can put all five steps within the try block and catch errors that occur in any of those five steps using the one catch statement.

  3. Thanks, Gregory, for the feedback! Ironically, I did construction for years, as a part-time and summer job, from high school (two years of drywall) to college (pretty much everything) and for a while after. I miss the physicality and the immediacy of seeing results. On the other hand, I'm not completely exhausted at the end of the day. I know you're not doing the physical stuff, but I thought I'd share that coincidence.

     

    I think your idea of using IT to improve the industry is an excellent one. I hope you're able to do that and let us know if you have any questions along the way.

  4. Not so sure about that conventional wisdom! As far as I'm concerned, anything that starts with "ALWAYS" isn't that wise. Some people prefer prepared statements and others don't. I would never say prepared statements are better than standard queries or vice versa. Each is better in some situations. Both are equally secure, in my opinion (if you take the right steps).

     

    Once you set aside the security question, I think of prepared statements as being better for situations where the same query is run multiple times in a script. That's why line 41 uses them for that query but line 23 uses a standard query (because there's no benefit gained by using a prepared statement).

  5. Thanks, Terry, for helping out. Excellent post! I have used GoDaddy on a personal project (not my choice), and while it's serviceable, I wouldn't choose GoDaddy. Avoid Dotster like the plague. They are the worst hosts I've had in 12 years of doing this.

     

    I would generally avoid any hosting company that does "hosting and..." or "...and hosting". Stick with a company that just does hosting.

  6. All 4 vars are blank when I echo them out.

    So it still leads me to the rewrite rule not passing them.

     

    Yes, that would suggest your rewrite rule is not working. But it's working for the shop/sales link, and it's working well enough to get to browse.php. It's the backreferences that aren't working. As Terry suggests, I would recommend going back to your hosting company. Because the rule itself is written correctly. Any hosting company worth their salt ought to be able to help some. And if they won't, what good will they be when a serious problem comes up?

     

     

    RewriteRule ^browse/coffee/Dark+Roast/2$ browse.php?type=$1&category=$2&id=$3

    hasnt worked either which it should for just that particular llink anyway.

     

    Well, that's not going to work because you've got no groupings in the match to use as the values for backreferencing in the redirect.

  7. Sorry, I missed that you had said that in your earlier posts.

     

    Okay, going with your second site, which seems to be working better, the URL http://www.acmaine.com/browse.php?type=coffee&category=Dark+Roast&id=2 works fine, showing no products found. But if you go to http://www.acmaine.com/browse/coffee/Dark+Roast/2, which should work, you get the error. Now the browse.php script shows that error if this conditional is false:

     

    if (!$type || !$sp_type || !$sp_cat || !$category) {

    So what you should do is echo out the values of all those variables in order to see which one is the problem. Then you can debug from there.

     

    Thanks for the nice words on the books!

×
×
  • Create New...