Jump to content
Larry Ullman's Book Forums

Fergal

Members
  • Posts

    16
  • Joined

  • Last visited

Posts posted by Fergal

  1. 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;

     

    This <strong>is</strong> a line

     

    This is another line

     

    How could the functions above be used so that when the data is printed to the browser it looks like this;

     

     

    This is a line

     

    This is another line

     

    Thanks!

  2. Page 18 of the book refers to the print function in the PHP manual - http://www.php.net/print. It says:

     

    ...the first value, int, says that print returns an integer value (specifically, print returns 1, always...

     

    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!

  3. 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;

     

    1. Statement
    2. Executable
    3. Compiled language
    4. Interpreted language
    5. Attributes
    6. Function
    7. Argument (not sure if that's from Ch 1)
    8. Function
    9. 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!

  4. 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...