|
-
Oct 7th, 2010, 05:23 PM
#1
Thread Starter
Hyperactive Member
[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.
-
Oct 7th, 2010, 05:54 PM
#2
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; ?>
-
Oct 7th, 2010, 06:49 PM
#3
Thread Starter
Hyperactive Member
Re: Conditional statement help
Kows,
worked great.
thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|