Jump to content
Larry Ullman's Book Forums

Larry

Administrators
  • Posts

    5413
  • Joined

  • Last visited

  • Days Won

    155

Everything posted by Larry

  1. Where are you placing your site files and what URL are you using?
  2. If you use a browser which allows you to dynamically resize the textarea (I used Safari), you'll see that it's an issue with the width of the textarea. Has nothing to do with the JavaScript.
  3. You're quite welcome. As for what you're experiencing, this is how MySQL behaves: if you run an UPDATE query that works (i.e., executes without error) without actually changing any values, then the number of affected rows is 0. If your PHP scripts just checks the number of affected rows, it'll seem like there was a problem when there wasn't. The alternative is just to check that the query ran without error.
  4. I think the problem is due to the width of the textarea. If I shrink the width, the cursor moves to where it should be.
  5. Hello James. I'm not saying you're wrong, because you've seen what you think you've seen, but based upon what I know, it makes no sense at all that query errors in a PHP script would case a 500 error. In 12 years of PHP development, I've never seen a problem with a PHP script's queries causing a 500 error.
  6. I think you're overcomplicating this. As Abigail said, you need to be able to access www.example.com/ipn.php (or whatever the correct path and filename are) directly in your browser. This is the same as if it were any other PHP script. Understand what the proper URL is first, make sure that loads without error, then make sure PayPal has that proper URL.
  7. The standard PHP-MySQL debugging techniques are to print out the query being run, which the code already does, and run that very same query using another interface, such as phpMyAdmin or the mysql client. That way you can directly see the MySQL result.
  8. And I appreciate you attempting to provide all the information; much better to provide too much than not enough, but this is a bit ridiculous. Try to post the pertinent information in the future, please, not the entire debugging output. There's a point where so much information becomes unusable.
  9. I'm not exactly sure what you're asking here but it sounds like you're not quite grasping it.
  10. The slash is never stored, it's just used to prevent the query from breaking.
  11. The explanation is most likely that the initial zero is being dropped because, as a number, there's no difference between 012 and 12. Treat it as a string and the problem will go away.
  12. So your $stmt variable probably has a FALSE value, meaning that mysqli_prepare() failed. This is either because there's a problem with your connection or with the query. I don't know that this would cause the problem, but I'd start by removing the extraneous spaces you have in the query string. You can then include code that checks $stmt and if it has a false value, you call the mysqli_error() function.
  13. The problem is you're separating sii with commas, which is not the correct syntax. It should just be sii.
  14. Good question. I would come up with an organization scheme now that is viable for the long term and you're right that putting al of the images in two directories will eventually become a problem.
  15. I wouldn't take how long it took to receive this email as any sense of things. There are too many considerations there. If I were you, I might be inclined to get UK hosting, but I wouldn't be bound to it.
  16. I'll look into this and see what I can figure out.
  17. Lou, thanks for the nice words on my books and for your interest in them. It is appreciated. As for your situation, I don't have much to offer, as everyone learns and works differently. I can say that you may benefit from starting off smaller and working your way up to your end goal. Even 12 years into my career, with each project I learn something new and hopefully do the whole project in a better way. Reading as much as you can is great, but that can also confuse you, as different writers/programmers have different methods and approaches. At the end of the day, you need to sit down and your computer and do it yourself. I don't know if you're subscribed to my newsletter or not, but you may appreciate this article from earlier this year: http://www.larryullman.com/2011/02/01/what-is-larry-thinking-36-becoming-a-better-programmer-and-more/#thinking And, yes, my degree is in English. I have no formal computer training save for one Pascal class in 1989. That actually goes towards my work as a writer, though. I credit my programming abilities to two years spent working with symbolic logic. For about 95% of the cases, solving problems and working things out is far less complicated and intuitive than I believe people think it is. The same goes for learning new technologies or languages: there's a difference between OOP and procedural programming, but procedural PHP is similar enough to procedural C and OOP Ruby is similar enough to OOP PHP. Once you grasp theories, the rest is just syntax.
  18. That's good information to know, then: the kind of information you should include when you're asking for help. You should also read the forum guidelines before posting again, so you can see what other information would be very beneficial to those of us trying to assist. But what you're saying doesn't make sense. You're printing out the exact query being run by your PHP script, with the values in it? And you run this exact query in the mysql client and it works?
  19. You're quite welcome. As for an example, the code would just be something along the lines of if (!headers_sent()) { header(...); } else { print 'Would have sent a header but I could not.'; } In a live site with things working as they should, you should have already worked out all the headers already sent issues. Sometimes, when developing something, you may appreciate using code like this to avoid getting secondary, confusing errors. For example, a script does X and then redirects the browser. If the script has an error before the header call, then you'll see the error and the headers already sent error, which can be confusing to some. So you could use that code to prevent that from happening. Using code like the above isn't obligatory, in the sense that I don't use it commonly, but it has it's merits.
  20. I forget whether I explicitly say this in the book or not (I believe I do), but some browsers, and by some I think I just mean IE, won't prompt for cookies when running sites on localhost. This is in a tip, I believe.
  21. Thanks for the interest in the books. As for the text color in DW, I have to say that's not really significant. As for the images issue, I expect your paths are incorrect or something. I don't use DW, so I couldn't say.
  22. Did you follow the explicit PHP-MySQL debugging steps as clearly explained in the chapter on debugging? There's a specific sequence of debugging tools you should apply here.
  23. Could you clarify what you mean by "this": using the code itself or a situation in which headers have already been sent? Really, anytime you need to send more than a one-word string along in a URL. For example, one page might do some validation or whatever and pass a message to another page.
×
×
  • Create New...