cyphix
05-14-2004, 05:25 PM
Having problems with this if statement..
I'm checking 2 form fields & their default value is "0" & I only want people to change them if they want to input another number... I don't want them taking away the "0" & leaving it blank.
Thing is... this works if one is blank, but if I leave both blank I don't get any errors.
if ($fmtext or $fmcheckbox == '') {
echo "Please leave all options you don't need set to zero & do not modify them.";
exit();
}
Also, how can you insert the value of a variable into a bunch of text without spaces in the text?
Like this...
$sn = 23;
echo "iam$sntoday"; // Doesn't work
echo "iam"$sn"today"; // Doesn't work
echo "iam($sn)today"; // Returns the brackets also but gets the value correct
Any tips?
Thanks!
I'm checking 2 form fields & their default value is "0" & I only want people to change them if they want to input another number... I don't want them taking away the "0" & leaving it blank.
Thing is... this works if one is blank, but if I leave both blank I don't get any errors.
if ($fmtext or $fmcheckbox == '') {
echo "Please leave all options you don't need set to zero & do not modify them.";
exit();
}
Also, how can you insert the value of a variable into a bunch of text without spaces in the text?
Like this...
$sn = 23;
echo "iam$sntoday"; // Doesn't work
echo "iam"$sn"today"; // Doesn't work
echo "iam($sn)today"; // Returns the brackets also but gets the value correct
Any tips?
Thanks!