Hi all,
This is my first post and am not really sure what forum to post this in. I have searched the web but have been unsuccessful in finding a script that give directions to a certain destination (like a hotel) by adding your postcode. An example can be seen here: http://www.falconhotel-castleashby.com/directions.htm
Are there any of you guys that have such a script?
Sorry for all the questions but I thought this was the best place to try 🙂
Thanks Beds
All the site you linked to does is use an HTML form that points to a Google Maps page to process the input. Try doing a "view source" on that page and search for "<form".
It calls a php file:
<form method="post" action="media/scripts/dirProcess.php" target="_blank">
Thanks
OK, but the result is a Google maps URL with 3 or 4 variables in the URL query string: http://maps.google.co.uk/maps?f=d&saddr=NN7+3LF&daddr=NN7+1LF&dirflg=h if the "avoid motorways" is selected, or http://maps.google.co.uk/maps?f=d&saddr=NN7+3LF&daddr=NN7+1LF if it is not selected. So all you should need is a form like:
<form action="http://maps.google.co.uk/maps" method="get" target="_blank"> <div> <input type="hidden" name="f" value="d"> <input type="hidden" name="daddr" value="NN7 1LF"> <label>Your Postcode: <input type="text" name="saddr"></label><br /> <label>Avoid Motorways? <input type="checkbox" name="dirflg" value="h"> </label><br /> <input type="submit" value="Get Directions"> </div> </form>
Oh, I see. I didn't realise that. Thanks a lot for showing how that is done 🙂
It was nice to see the logic here as I thought it would be far more complicated.
I appreciate your time.
Kind regards Beds
No problem. Also, I'm sure if you poke around google's site enough, you can find other options to include in the URL, if you need them.
PS: Don't forget to mark this thread resolved, if it is.