How should i allow the display of Date of Occurence in such a way

If user keys in a value range between $beginDate and $endDate
it displays this :
Date Of Occurence between: 23-03-2002 to 24-02-2005

if (!empty($beginDate)) {
echo "<b>Date Of Occurence between: $beginDate1 to $endDate1</b><br>";  
}

and if user keys in value for the $endDate
it displays this:
Date Of Occurence before: 24-02-2005

if (!empty($endDate)) {
echo "<b>Date Of Occurence before:  $endDate1</b><br>";  
}

i tried using else if but the codes are within a else{} so can't use else again

else{

// display of search results
}
if (!empty($beginDate) && !empty($endDate)) {
echo "<b>Date Of Occurence between: $beginDate1 to $endDate1</b><br>";  
} if (!empty($endDate)) { echo "<b>Date Of Occurence before: $endDate1</b><br>";
} }//end else

    i guess else if would do the job

      You can use else again. It's another if/else conditional block; you're free to put as many if/else as you want.

        Write a Reply...