Help with a php if statement

leroreast

New Member
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:\[code\]<?phpif ($this->input->post('submit') && $this->input->post('categories')): foreach($tagedImages as $image): ?> <div class="thumb"> <?php echo'<a href="http://stackoverflow.com/toKoritsi/uploads/'.$image.'"/> <img src="http://stackoverflow.com/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="http://stackoverflow.com/toKoritsi/uploads/'.$photo['name'].'"/> <img src="http://stackoverflow.com/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();?>\[/code\]thanks in advance!
 
Back
Top