newera
-
Posts
4 -
Joined
-
Last visited
Posts posted by newera
-
-
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; }
-
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?
-
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>'; }
Is It Necessary To Set Null
in PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
Posted
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 ?