Jump to content
Larry Ullman's Book Forums

newera

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About newera

  • Rank
    Newbie
  1. Ah I see, Thanks margaux! Another small doubt I have is on pg87, on script 3.5, shouldn't the form validation for $_POST['distance'] be using !empty function instead of isset since it's a text input ?
  2. Hmm thanks Larry and HartleySan (yes, it helps). For the following piece of code, is setting the gender to NULL necessary or is it just a good programming practice? (since if gender is not set, then it automatically means its NULL) Thanks! if (isset($_REQUEST['gender'])) { $gender = $_REQUEST['gender']; } else { $gender = NULL; }
  3. Thanks Sir, finding your book really helpful! I'm still a bit confused of the following. If nothing is typed into a particular input field in the form,doesn't that mean that the corresponding variable is unset and therefore Null?
  4. Hi guys. Is it really necessary to set the $name,$email,$gender to NULL? If they are empty, aren't they null then? Thanks! if (!empty($_REQUEST['name'])) { $name = $_REQUEST['name']; } else { $name = NULL; echo '<p class="error">You forgot to enter your name!</p>'; }
×
×
  • Create New...