Hello there! can somebody help me with this if statement? My form appears every-time I load the page but it disappears after I submit the form! Maybe it's the "endif" syntax that confuses me but I can't get this done properly... here is the code:
<?php
if ($this->input->post('submit') && $this->input->post('categories')):
foreach($tagedImages as $image):
?>
<div class="thumb">
<?php echo'<a href="/toKoritsi/uploads/'.$image.'"/> <img src="/toKoritsi/uploads/thumbs/'.$image.'"/></a>' ?>
</div>
<?php
endforeach;
elseif(isset($photosQuery) && count($photosQuery)):
foreach($photosQuery->result_array() as $photo):
?>
<div class="thumb">
<?php echo'<a href="/toKoritsi/uploads/'.$photo['name'].'"/> <img src="/toKoritsi/uploads/thumbs/'.$photo['name'].'"/></a>' ?>
</div>
<?php
endforeach;
endif;
$options = array(
'bracelet' => 'Bracelets',
'ring' => 'Rings',
'bag' => 'Bags',
'earing' => 'Earings'
);
echo form_open("toKoritsi/gallery");
echo form_dropdown('categories', $options, 'bracelet');
echo form_submit('submit', 'Choose');
echo form_close();
?>
thanks in advance!