[RESOLVED] Conditional statement help
i have a report that i have addresses and in the report i print to screen the words "Map It" instead of the address thats a link to google maps so the user can get a map. below is what i use
Code:
<td><font size="1" face="Arial, Helvetica, sans-serif"><a href="http://maps.google.com/maps?f=q&hl=en&q=<?php echo urlencode($address); ?>" target="_blank">map it</a></font></td>
it works great but it does it even when there is no address in a record.
i have tried a few different if statements with no luck. any help. also would like to know if i could highlight the cell in yellow if blank.
Re: Conditional statement help
PHP Code:
<?php if(!empty($address)): ?>
<td><font size="1" face="Arial, Helvetica, sans-serif"><a href="http://maps.google.com/maps?f=q&hl=en&q=<?php echo urlencode($address); ?>" target="_blank">map it</a></font></td>
<?php else: ?>
<td bgcolor="#f00"> </td>
<?php endif; ?>
Re: Conditional statement help
Kows,
worked great.
thanks again.