Jump to content
Larry Ullman's Book Forums

Larry

Administrators
  • Content Count

    5298
  • Joined

  • Last visited

  • Days Won

    145

Everything posted by Larry

  1. That error message doesn't occur where you think it does, but rather later on in the script if the query doesn't return any records. You'll need to apply the basic debugging steps to figure out why. Also, before you post again, make sure you read the forum guidelines and include pertinent details, such as the versions in use.
  2. Yes, exactly. Although...you can't have a variable named $2week and that would come from the database and it'd be a number, so you shouldn't use quotes around it. You can simplify this code in a couple of ways, too. I'd be inclined to have one conditional that confirms payment status, receiver email, mc currency, and txn ID. Then another conditional determines the expiration increase based upon the value of mc gross and the two week subscription. But that's all minor stuff. It looks like you've got the premise down.
  3. As I say in a tip, I've not found a third-party plug-ins to be nearly as good as the commercial ones. I've never personally tried to develop one either. If I'm going to work on a site that needs that feature, I just roll the $70 or whatever into the price of the project. But that's just me. Perhaps by looking at some of the third-party plug-ins you could get a sense of how they work.
  4. Thanks for the nice words and I hope you like the other book. Let us know if you have any questions or problems.
  5. Hello Sam, Thanks for the nice words. Me teaching you PHP is probably a lot easier than you teaching me to be a vet! Okay, and I'm just free thinking here, you could add a two_week column to the table. A user registers and the expiration is set to yesterday and the two_week is 0. The user goes through PayPal. The first time the IPN sends back a 0 amount, if two_week is still 0, meaning they haven't done a two-week subscription yet, you set the expiration to 2 weeks from now and update the two_week to 1. When future IPNs come in, with appropriate amounts, you add a month to the expiration. If another 0 amount comes through for that same user, they don't get credited another two weeks because they already had that. Does that sound like what you want to do?
  6. Before I answer the question, just out of curiosity, what's the benefit of having one button that just toggles another button (as opposed to having the first button toggle itself)?
  7. Sorry, Jorge, that I didn't get you an answer. There was a ton of code to review, so I put it on my watch list to get back to it and...apparently I never did. Sorry about that. Kudos for figuring it out and thanks for posting the solution.
  8. Thanks for your question, Terry. I don't really do anything with Windows at all, let alone development for Windows. In fact, even things that I think are decent, like ASP.net, which extend to a broader audience, are pretty much useless to me because it requires Windows for development and hosting. So, all in all, not my cup of tea. But thanks for thinking of me!
  9. Live and learn, eh? Not so sure about 5.3.6 and a built-in Web server. The idea itself kind of surprised me when you mentioned it, and in doing research, there's nothing about that in the release notes for PHP 5.3.6, and the only place I find any mention of the idea is in association with a guy that I consider to be a crackpot. So...
  10. Hey Terry, I posted this on my blog and in the newsletter and on Amazon as it's complicated and a bit embarrassing. PHP 6 never existed, officially. When I wrote the book, PHP 6 was about halfway done, so I used the beta version of PHP 6 in writing the book. The main feature of PHP 6 that I wanted to highlight was support for Unicode, which is pretty important in a global sense. But since the book was written, changes took place and it turned out that it got to be very complicated to continue PHP 6 as they were planning. So PHP 6 was shelved. Some of its features made their way into PHP 5.3, including most of the PHP 6 stuff that I discussed in the book (which is only about 5% of the book's material). I don't even know if there's a plan for PHP 6 now. Ironically, I tried to incorporate PHP 6 discussion into the book so that the book wouldn't be outdated too quickly after being published. Instead, three years later (I think), the book is still too far ahead! And, doubly ironically, the PHP 6 stuff was really hard to write as there was barely any decent documentation on it. Often I had to look into PHP's core code to figure out what functions existed and how they were used. As I said, I'm a little embarrassed about that, but I've learned a valuable lesson: not to go too far out on a limb! So the short answer of "Why learn PHP 6?" isn't you shouldn't because it doesn't exist!
  11. Thanks, Terry, for the interest in the books!
  12. It's really not prudent to use the IPN without SSL: too much data is being transmitted in the open if you do that. If you're doing e-commerce, I think you just need to accept the additional cost of having SSL. Besides, you might want SSL for your admin pages or elsewhere. It's only a couple of hundred dollars and the lack of SSL will cost you more in the long run (due to lost sales and the inevitable security violation).
  13. You'll have to import the data using a command line tool, such as the mysql client with batch mode or mysqlimport.
  14. First, thanks for the interest in the book! The book uses the basic version of PayPal for one example and then Authorize.net for the other. The Authorize.net system is equivalent to PayPal Pro. So, in short you get to see both approaches. As far as I know, this isn't an issue with what's in the book, but I always add additional issues and thoughts on my Web site in support of the book. No, the PayPal example in the book is a fixed-price item. But, yes, you don't want to pass the price to PayPal. I think it's well more than 2 pages. From some of the debugging help I've provided in the forums, it seems that I could have gone through that section in greater detail, but everything is explained well, I believe. You can also go without the htaccess stuff, too. No, you should be just fine. You're quite welcome. Thanks again for the interest! I have not and I have not heard this from my host, but a lot of factors go into performance issues.
  15. Thanks for your input, Josee. Yes, I've heard complaints about the Adobe Digital Editions before. It wasn't something I was familiar with. I've requested that Peachpit remove all DRM from all of my books, too. What you say about PDFs makes sense. One great thing about doing this myself is I should be able to output the content in any format I want. I'll need to create a PDF for the print version of the book, but there's no reason I can't output a different kind of PDF for the screen. I'll just need to figure out what that means...
  16. The code you posted doesn't show PHP echo'ing or printing the value of $id. What does the HTML source code of the page look like (specifically for that input)?
  17. Thanks, Gregory. And thanks for the very, very nice review at Amazon. Much appreciated! Feel free to post any questions you may have. That's what the forum is for!
  18. HartleySan, when people talk about self-publishing, they think about the amount of control and higher profits, but I honestly don't think it's feasible without already having some "base" or "following", be that Twitter or a blog or existing books. Ironically, by having already published 20 books (and the other promotional stuff I do), a self-published book of mine is much more likely to be successful today than one I could have written 5 years ago. I have that same O'Reilly book, although I bought mine about 10 years ago, so it's really outdated. Like pretty much all O'Reilly books, it's an excellent and exhaustive resource but not necessarily the best book to learn from. Thanks for your thoughts about JavaScript 2.0. I'm thinking of a way to make the purchase of a book qualify a person for free updates for life (or five years or something). That way, rather than trying to shoehorn discussion as to what JavaScript 2.0 will be into this book, I can just update the book when JavaScript 2.0 comes out. Of course, I can't provide free updates of printed books and maybe not those sold through Amazon so... Stuart, yes, I'm doing the JavaScript book first, then one on Yii (assuming the whole thing hasn't blown up in my face by then and I've decided to scrap the idea). From a business perspective, it'd probably be better to do the Yii book first, but I've been promising the JavaScript book for a long time and people want it. Plus, I already had the book outlined. Thanks everyone!
  19. Jonathon, I think I have a decent-sized "following", but to put that in perspective, if everyone currently subscribed to my newsletter and currently registered in this forum buys a copy of a self-published book, I'll basically make just about the bare minimum I would be guaranteed to make if I went with a publisher. And, of course, not everyone is going to buy a copy. On the other hand, if I sell as many copies of a self-published book as I have some of my best selling traditional books, I'll make a small fortune. Okay, not a small fortune, but it'd be quite beneficial. So I'm trying to approach this with open eyes. I am dedicating the bulk of this year to making this happen (and learning what I need to learn), so I'll make the time and am prepared to not make much money this year on that account. Better to have tried and failed...though. At the end of the year I'll have tried something new, learned a whole lot, and made somewhere between not that much money and a decent amount. In the grand scheme of things, that's a good year. And, yes, a self-published book on apps or whatever would make sense. Basically I don't learn anything these days without writing a book about it! Stuart, thanks for the input and for volunteering. Much appreciated. Will keep that in mind. In learning several languages and technologies over the past 12 years--PHP, MySQL, HTML, JavaScript, CSS, OOP, C, C++, Ruby, Flex, what I've figured out is this: what's really important is learning how to learn, understanding approaches to common problems, and knowing how to debug. Although there are cultural differences between, say, PHP and Ruby, at the end of the day, the biggest difference is just syntax. Once you understand UI and form validation and data storage, etc., it's largely a matter of capitalization and balancing parentheses and semicolons (or not) and such. So I'm not worried about tackling iOS when the time comes. Certainly, there's that last 20% of a technology, the mastery of which differentiates the capable programmer from the extraordinary one, but 80% of lots of programming languages are really common ground.
  20. You're quite welcome. That's what the forum is for. Thanks for your interest in my books!
  21. Thanks for the input! I've only barely looked into this, but clearly the printed book will have the biggest expense on my end, but I am dedicated to selling printed versions. I can generate PDF, epub, and mobi formats at no cost, really. The issue, then, is where the item sells from. If it sells from Amazon, they take a percentage of the price, like maybe 55%. I don't know what rights I'll have to sell things through my own site at a different price than Amazon. I have an amount in mind that I'd like to personally get per book (after expenses) and I have a maximum in mind that I'd feel comfortable with people spending (probably $15-$25, depending upon the format). So it's going to be a matter of striking the right balance between those two numbers. My (former) agent actually mentioned the apps idea to me, which I wouldn't have otherwise considered. But it would allow me to, I think, put demonstrable JavaScript with the book. In other words, you're reading the book, here's a bit of code, click this button to see the results in action. It's a whole bigger level of effort and knowledge involved (on my part), but it could be an excellent use of the app technology and a good way to set the book apart from others.
  22. Big thanks, Jonathon! I should get around to writing that alleged JS book. Out of curiosity, what format do you think you'd prefer it in? Printed, PDF, mobi (Kindle), ePub? I'm going to make it available in as many ways as possible, but would like to know. I'm even thinking about turning it into an app (both iOS and Android), down the line.
  23. Excellent idea, Jonathon! If this self-publishing thing works out, I guess there are a lot of books that I could do now that I've thought about doing over the years.
  24. You're quite welcome. That's what the forum is for. Thanks for the nice words!
  25. Alvaro, thanks for the nice words. By the way, it really sounds to me like you're duplicating a process. I haven't worked with CodeIgniter, but most frameworks use one key file (called the bootstrap) through which all requests go. Values are passed in the URL to tell the bootstrap which specific module to include. This is what I do in Chapter 2. So to me, it sounds like you're trying to emulate a framework-like system using a framework, when maybe you should just be using the framework and ignoring the approach in that chapter (which is kind of a watered-down framework)?
×
×
  • Create New...