Jump to content
Larry Ullman's Book Forums


  • Posts

  • Joined

  • Last visited

Posts posted by Spongebob

  1. Line 24 of the script:

    <p><label for="gender">Gender: </label><input type="radio"  name="gender" value="M"> Male <input type="radio" name="gender" value="F"> Female</p>

    Generates two - "Missing associated label" warnings and one "invalid id reference" error when using JetBrains PHPStorm 2020.2.  Why and how can this be corrected? 

    Despite the warnings and error messages, the script functions correctly.

    Thank you!

  2. The table rows represent an animal species. The cells within a row represent traits of that species.  


    User data is compared against the corresponding data in row cell of the table (http://virginianaturalhistorysociety.com/temp/table.png)

    When user data matches the corresponding cell in a row a 1 is returned, else a 0. Table rows are then sorted by highest score (most matches) and displayed to the user.


    For example:


    The user data = Sandhills, Slender, Smooth, Uniform, Brown, White


    The user data is  compared against the corresponding data in each row cell of the table (http://virginianaturalhistorysociety.com/temp/table.png)


    Species (row) one has 3 matches

    Species (row) two has 4 matches

    Species (row) three has 6 matches

    Species (row) four has 3 matches


    Rows would be sorted by the number of matches:


    1. Species (row) three has 6 matches

    2. Species (row) two has 4 matches

    3. Species (row) one has 3 matches

    4. Species (row) four has 3 matches

  3. The objective is to have the user provide some characteristics via a form. Based on the user’s input the php program would output a resorted table placing the nearest match on the top, with the second closest match on the second row and so on. 

    I believe the table is small enough to store in an array?
    Some of the cells/fields can hold multiple values. Should these be stored as an array within an array?
    The full table has 40 rows.
    Thank you for your suggestions and advice.


  • Create New...