View Single Post
  #2 (permalink)  
Old Aug 21st, 2006, 13:23
moojoo's Avatar
moojoo moojoo is offline
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,950
Blog Entries: 1
Thanks: 0
Thanked 30 Times in 30 Posts
Re: Validating link to Street Map

I had to use google maps for a project and I wrote a little piece of PHP to dynamically create the URLs based on information in a DB and strip out some white space etc. This may help you be able to do something to parse the URL into something the validator likes.
Code: Select all
<?php
$str = $row_mem_list['address'];
$str = preg_replace('/ /', '+', $str);
$city = $row_mem_list['city'];
$city = preg_replace('/ /', '+', $city);
?> 
      <li class="directions"><a target="_blank" href="http://maps.google.com/maps?f=q&hl=en&q=<?php echo $str; ?>,+<?php echo $city; ?>,+<?php echo $row_mem_list['state']; ?>+<?php echo $row_mem_list['zip']; ?>">Get Directions</a></li>
__________________
I hate IE 6. Just sayin....
http://www.mevans76.com

Last edited by moojoo; Aug 21st, 2006 at 16:12.
Reply With Quote