Help with if then statement

4 posts by 2 authors in: Forums > CMS Builder
Last Post: February 10, 2016   (RSS)

I want to write if there is a quickship image load this image


<?php foreach ($record['quickship_image'] as $upload): ?>
<?php if ($upload['isImage']): ?>
<a href="<?php echo $record['link'] ?>"><img src="<?php echo $upload['urlPath'] ?>" alt="" class="img-bord" width="150" height="150" border="0" /></a> <?php endif ?>
<?php break; ?>
<?php endforeach ?>

ELSE load this:

<?php foreach ($record['main_image'] as $upload): ?>
<?php if ($upload['isImage']): ?>
<a href="<?php echo $record['link'] ?>"><img src="<?php echo $upload['urlPath'] ?>" alt="" class="img-bord" width="150" height="150" border="0" /></a> <?php endif ?>
<?php break; ?>
<?php endforeach ?>

But dont load both.

I tested your code and it is showing both images.

It is working. I didnt refresh the page. Thank YOu.