sandecki Posted September 29, 2007 Share Posted September 29, 2007 Hey everyone, I have a simple question and hopefully someone can be kind enough to help . I need to make a simple php script\form to do the following.... 1. Allow some to enter their zipcode in the text field & hit submit. 2. This will then open a new browser page with the following URL below... http://www.google.com/maps?f=q&hl=en&geocode=&q=self+storage+ZIPCODEHERE&ie=UTF8&z=12&om=1 The bolded text is where the zipcode should of been inserted. The entire URL must stay intact, I just need this simple thing and my lack of php knowledge really makes it awful, hopefully someone can help. I'd like to give thanks very much to whoever decides to help me with this! Quote Link to comment https://forums.phpfreaks.com/topic/71170-help-with-simple-script/ Share on other sites More sharing options...
The Little Guy Posted September 29, 2007 Share Posted September 29, 2007 Like this: <?php if(isset($_POST['submit'])&&!empty($_POST['zip'])){ header("Location: http://www.google.com/maps?f=q&hl=en&geocode=&q=self+storage+".$_POST['zip']."&ie=UTF8&z=12&om=1"); exit; }else{ ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <input type="text" name="zip"> <input type="submit" name="submit" value="Submit"> </form> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/71170-help-with-simple-script/#findComment-357980 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.