Jump to content
Larry Ullman's Book Forums

Larry

Administrators
  • Posts

    5413
  • Joined

  • Last visited

  • Days Won

    155

Everything 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. Thanks for letting us know. Presumably Skype was running on the same port as Apache, thereby causing the conflict. I suspect, if that's the case, you changed the default port for either Apache or Skype to solve the problem.
  3. Thanks for the nice words. Much appreciated. I expect you have missed something or done something wrong, but couldn't say what it is with the information provided. For starters, how about telling us the versions of PHP and MySQL in use? And providing a URL that you're using.
  4. It looks like the SQL file got corrupted somehow. Sorry about that. I just uploaded a fresh version of the scripts. Let me know if you continue to have problems with it.
  5. Yes, that's what the binary data should look like. What you posted before is data in hexadecimal format.
  6. Excellent! Kudos for figuring that out and thanks for sharing so that others might benefit! Glad it's working for you now.
  7. Well, I'm happy to try and help, but need specific questions to answer.
  8. 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.
  9. I don't know exactly what you mean by "get around this", but I will say that this code: $file_name='F:/backups/$db_name/{$table}_{$time}.sql.gz'; won't work because variables within single quotes aren't extrapolated.
  10. 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.
  11. Okay, so post the code you're using now, after making those changes.
  12. The problem is in your script. You have enctype="multipart/form_data" when it should be enctype="multipart/form-data".
  13. 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).
  14. I've never used myLittleAdmin, but I expect you'll be fine. The important thing is just that you have some way of interacting with the database.
  15. Hello Paul, You need to get the value out of the function somehow. A function is a "black box": the code outside of the script can't see into it. So the function's return line is how the function returns a value. When the function is called, the returned value is assigned to $sum. Does that answer your question?
  16. I forget offhand what the output of the backup is. Maybe .sql? If so, you can use plain/text as the file type. Can't answer the other question given the (lack of) information provided.
  17. 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.
  18. I can certainly try, but mostly it'll be me looking through the PayPal documentation to find you the answers.
  19. Thanks for the nice words on the book. Sometimes you can create two database connections by assigning them to two different variables. However, database connections are expensive, in terms of server resources, so I'd recommend finding a different way. For example, you can use one connection but switch databases as needed.
  20. 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? 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.
  21. Not a problem for asking. The try...catch syntax is just an elegant way to perform error handling for blocks of code. In a fully developed application, the catch would do something with the error, though.
  22. 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!
  23. Yeah, if you want a long-term "remember me" feature, you have to use cookies. Sessions only last for a short time, by default.
  24. Are you certain that you're allowed to do .htaccess on both sites?
×
×
  • Create New...