Jump to content

Help with simple script...


sandecki

Recommended Posts

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!

 

 

Link to comment
Share on other sites

Like this:

<?php
if(isset($_POST['submit'])&&!empty($_POST['zip'])){
     header("Location: http://www.google.com/maps?f=q&hl=en&ampgeocode=&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 } ?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.