php if then based on checkbox

2 posts by 2 authors in: Forums > CMS Builder
Last Post: December 5, 2008   (RSS)

By bruno - December 5, 2008

I'm trying to display (or not display) an image based on a check box selection :

<?php

require_once "/home/brookspr/public_html/cmsAdmin/lib/viewer_functions.php";

list($propertiesRecords, $propertiesMetaData) = getRecords(array(
'tableName' => 'properties',
'perPage' => '10',
));

?>



<?php foreach ($record['main_photo'] as $upload): ?>


<?php if ($record['featured_property'] == "1"): ?>


<img src="<?php echo $upload['urlPath'] ?>" border="0" alt="<?php echo $upload['info1'] ?>" />







<?php else: ?>
<?php endif ?>

<?php endforeach ?>




I keep getting this error:

Notice: Undefined variable: record in /home/brookspr/public_html/properties/test.php on line 25 Warning: Invalid argument supplied for foreach() in /home/brookspr/public_html/properties/test.php on line 25

...not sure what im doing wrong. I attached the php file

Thanks!