I would try:

if (isset($fieldname) && empty($fieldname)){
  // do something here with the variable
} else {
  $fieldname="na";
}  // if (isset($fieldname) && empty($fieldname))


Cal
http://www.calevans.com


-----Original Message-----
From: Jacky@lilst [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 3:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] check null value


If I have one input text box that when it is submitted to next page, I want
to check first if it is nothing, then write "na" on next page, else just
echo whatever it is, is it correct to do this?

if ($fieldname == ""){
$fieldname ="na";
}
...
(then come to the html bit below)
<td><?php echo $fieldname ?></td>

I wonder specificly about the check if it is null part if it is corerct. Any
thoughts?
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to