06-21-2012, 02:34 PM
(06-07-2012, 07:47 PM)RubiksHQ Wrote: You could have used the empty() function instead of
PHP Code:If ($_POST["text"] == "" || $_POST["pass"] == ""){ echo '<script>alert("Please enter something into the text boxes!")</script>';
Technically speaking, empty is a language construct, not a function. The most obvious difference between a language construct (that requires parenthesis) and a function is that you are unable to have a variable as a name for it (unlike in a function).
PHP Code:
$a = 'empty';
if($a($_POST['b'])) #invalid
$c = 'trim';
$d = $c($_POST['b']); #valid
@BreShiE, there's no need for you to question if there is input in the third IF statement because the ELSE part of the second IF statement will make sure of that.