|
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>
Last edited by moojoo; Aug 21st, 2006 at 16:12.
|