Re: [gkornbluth] Need help with IF statement
Works Jerry. Thanks and I have your online book. I should refer to it more often.
Below is my code that I have with that works:
<?php foreach ($featuredRecords as $record): ?>
.....
....
....
...
<?php if ($record['event_venue_facebook_link']): ?><?php if (!preg_match("/^http:\/\//", $record['event_venue_facebook_link'])) {$record['event_venue_facebook_link'] = "http://" . $record['event_venue_facebook_link']; }
?><a href="<?php echo $record['event_venue_facebook_link'] ?>" target="_blank"><img src="/images/facebook_small22.png" /></a><?php endif ?><?php if ($record['event_venue_twitter_link']): ?><?php if (!preg_match("/^http:\/\//", $record['event_venue_twitter_link'])) {$record['event_venue_twitter_link'] = "http://" . $record['event_venue_twitter_link']; } ?><a href="<?php echo $record['event_venue_twitter_link'] ?>" target="_blank"><img src="/images/twitter_small22.png" /></a><?php endif ?>
<?php endforeach ?>