Jump to content
Larry Ullman's Book Forums

jskintauy

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by jskintauy

  1. Hi All,

     

    I am struggling with the naming of values and a comparison operator. I was fine with how this all worked until I ran into this snippet of code. I am not sure how it works or the logic behind it.

     

     

    function create_radio($value, $name = 'gallon_price') {

     

    // Start the element:

    echo '<input type="radio" name="' . $name .'" value="' . $value . '"';

     

    // Check for stickiness:

    if (isset($_POST[$name]) && ($_POST[$name] == $value)) {

    echo ' checked="checked"';

    }

     

    // Complete the element:

    echo " /> $value ";

     

    Specifically, the comparison value of ($_POST[$name] == $value) doesn't make since to me. We defined the variable $name as 'gallon_price' and $value as some input which would normally be our supplied gasoline price (a number) I understand this is not really here to comare actual values but to see if they are set, but I don't see how this does this. It seems more logical to see that $value is set. Can someone explain how this works?

     

    Signed - Confused a bit.

     

    Jim

  2. Hi All,

     

    I am new and have been doing some posting on Sitepoint, working on a project, taking the Lynda.com class (more on that in a minute) and now going through this book.

     

    Importantly, I found the class on Lynda.com very good until the project started (building a CMS), and then the complexity seemed to build very steeply, and I was clearly unprepared. This is in no way a reflection of Lynda.com (learned HTML, CSS to a decent level and could even build my own simple website afterward with little problem. Further, I can't recommend the Wordpress theming class enough) or even of the PHP class. I just felt overwhelmed.

     

    I started looking for a good book to supplement or replace the class and I figured this one was one of several that might work. I can't tell you how happy I am. The book explained several things I was unsure of in the first 3 chapters and got me started effectively on being able to apply the basics. I am now half way through the book and feel much more confident. The Review and Pursue sections worked well to make sure the material stuck. Mr Ullman just explains things in a way that I get! I can't say how important it is to be able to break down a topic into digestable pieces and explain it so the reader understands. A lot of tech book authors don't even come close.

     

    I am looking forward to completing this book, finishing my project and learning Javascript with the help of your "Modern Javascript" book.

     

    Thanks for putting out a great product!

     

    Jim

    • Upvote 1
×
×
  • Create New...