Jump to content
Larry Ullman's Book Forums

Fergal

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by Fergal

  1. I've just seen in the book that there is another way of doing this and that is by applying the nl2br function after the strip_tags function, as in; $string = strip_tags($string); $string = nl2br($string);
  2. I've been reading the section of the book on how to use the following functions; htmlspecialchars() htmlentities() strip_tags() My question is, is it possible to use those functions to deal with HTML tags included in text entered into a form, but still maintain the line breaks in the form data. For example if the following was entered into a textarea on a form; How could the functions above be used so that when the data is printed to the browser it looks like this; Thanks!
  3. Thanks Larry. I'm deliberately trying to break the scripts I write now and it has really helped my understanding of the book's content.
  4. When I run; it outputs 4,675.55555000000003929017 Where do the extra "3929017" digits come from? Thanks!
  5. Thanks for the reply Jonathon, I'm not familiar with curly brackets yet, but will hopefully get to them soon. As regards to using print with arrays, like the one I referred to above, Larry wrote the following in the book;
  6. I'm asking this question based on the section on p.57, "Receiving Form Data in PHP". When a form uses method="post" why does cause an error, whilst doesn't? Both statements have single quotes inside double quotes. Thanks!
  7. Thanks Larry. What does that actually mean? Is 1 the same as TRUE in this instance?
  8. Page 18 of the book refers to the print function in the PHP manual - http://www.php.net/print. It says: I know how print "something" outputs a string, but I have no understanding as to how print always returns 1. Could someone please explain what is meant by the statement I quoted? Thanks!
  9. Apologies if I gave the wrong impression, my comment was meant as a joke. I know from personal experience that Larry is extremely generous with his books. Thanks everyone!
  10. Thanks very much for your replies Jonathon and Hartley, the detailed info you provided clarifies a lot of the issues for me. I will keep going through the book and the terms should become much more understandable to me as I see them used more often. Jonathon you should ask Larry for a copy of the book in return for the very helpful advice that you give to members here
  11. I've been reading this book and got to Chapter Six and ran into some difficulties. I felt that I had gone through the book too quickly so I've started again and am being much more thorough in both reading and playing around with the code this time round. Being completely new to any form of programming I'm having some difficulty understanding some of the basic concepts in chapter one. For example I don't understand what the following really mean; Statement Executable Compiled language Interpreted language Attributes Function Argument (not sure if that's from Ch 1) Function Language construct I know that these terms are explained in the book and I've spent some time looking them up in Wikipedia. However, I still feel that I don't fully understand them. Could you by any chance recommend some basic programming resource / tutorial that would explain these? Thanks!
  12. Jonathon, thank you very much for that, I'm a Muppet, I had an extra "t" in meta. I'll have to train my brain to spot these errors quicker.
  13. I've started doing the practical examples in this book and didn't get very far before running into an issue, sorry but I felt it was important to get this page right because I will use it as a template for other work as I go through the book. I created this welcome page. When I run the page through the HTML Validator I get three errors and three warnings. The issues seem to resolve around line 5 of the code as shown below; <metta http-equiv="content-type" content="text/html; charset=utf-8" /> Have I made a mistake in that code or is it safe to ignore those error / warning messages? Thanks!
×
×
  • Create New...