On Wed, 2004-02-18 at 19:29, Paul M Foster wrote:
> When coding forms in PHP, is there a _simple_ way to ensure certain
> required fields are actually filled out?
>
> Paul
You can use empty() or isset()
<?php
$var = 0;
// Evaluates to true because $var is empty
if (empty($var)) {
echo '$var is either 0, empty, or not set at all';
}
// Evaluates as true because $var is set
if (isset($var)) {
echo '$var is set even though it is empty';
}
?>
The Logan
-- 05:05:01 up 3 days, 10:22, 3 users, load average: 0.06, 0.39, 0.72 Did you know the word "gullible" isn't in the dictionary? ICQ: 72101412 AIM/Yahoo: LoganTheClever Registered Linux User: 277727
This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:00:17 EDT