strlen question

message from melissa on 23 Jul 2004
<?php if(strlen($_POST['item01']) > 0) { ?>

<?php } ?>

(with the help of this forum!!)

the form is separated into 5 sections and if there are no items filled out
in that section, then i need to hide the title too.

I have been playing around with the syntax and am not having any
success.......any suggestions?

here is a sample of what i am trying:

<?php if(strlen($_POST['item01', 'item02', 'item03']) > 0) { ?>

<?php } ?>
 
gareth replied to melissa on 23 Jul 2004
<?php if((strlen($_POST['item01']) > 0) || (strlen($_POST['item01']) > 0) ||
(strlen($_POST['item01']) > 0)) { ?>

Title goes here

<?php } ?>

Basically, you use the OR operator || , so if one of the items has a length
greater than 0 the title will be shown
 
gareth replied to gareth on 23 Jul 2004
Sorry, should have been

<?php if((strlen($_POST['item01']) > 0) || (strlen($_POST['item02']) > 0) ||
(strlen($_POST['item03']) > 0)) { ?>
 
Gary White replied to gareth on 23 Jul 2004
Or you could do something like:

?>php
if (strlen($_POST['item01'].$_POST['item02'].$_POST['item03'])>0)){
?>

Gary
 

Archived message: strlen question (Macromedia Dreamweaver Web Design)