Jump to content

If... elseif... else... ??


Pasa Mike

Recommended Posts

this code is not returning any errors... yet none of the three sections are working properly... They all have the same structure, so whatever is wrong with one is wrong with another.... I am having one additional problem as well... In the price info section, after the year is displayed, a "1" is printed on each line for the 'due1'... 'due2'...etc...

 

<!-- Meet/ Start Time -->

<?php if ('time1display' == 0) {

echo "Meet Time: "; }

else echo "Start Time: ";

?>

<span class="Wtext"><?php echo $row_content['time1']; ?>

<br />

<!-- End / Return Time -->

<?php if ('time2display' == 0) {

echo "End Time: "; }

else echo "Return Time: ";

?>

<?php echo $row_content['time2']; ?></span>

  </p>

<p>

<!-- Price information -->

<span class="Wtext">

<?php if ('price' == 1)

break; 

elseif ('price' == 2) {

echo "Event Cost:";

echo $row_content['due1']; }

    else {

echo "Event Payment Schedule:<br />";

echo "Payment 1: ", $row_content['pay1'], "  Due Date: ", print date('M j Y', strtotime($row_content['due1'])), "<br>";

echo "Payment 2: ", $row_content['pay2'], "  Due Date: ", print date('M j Y', strtotime($row_content['due2'])), "<br>";

echo "Payment 3: ", $row_content['pay3'], "  Due Date: ", print date('M j Y', strtotime($row_content['due3'])), "<br>";

echo "Payment 4: ", $row_content['pay4'], "  Due Date: ", print date('M j Y', strtotime($row_content['due4'])), "<br>"; }

?>

 

Link to comment
https://forums.phpfreaks.com/topic/39002-if-elseif-else/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.