Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-26-2008, 07:00 PM   PM User | #1
DaKKie
New Coder

 
Join Date: Oct 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
DaKKie is an unknown quantity at this point
Pull Down submit

I need a little help here. I want to start a search and I want to start out with state and zip code. So I have a pull down with every state and D.C. and then I have a text area for the user to type in their zip code in that certain state.

I'm wondering what the easiest and most effective way to do this is. I was thinking of making a table that has 51 rows the the states and D.C. Then I'm thinking that's bogus. All I need to do it when the person chooses the states in the pulldown it posts that into the database and when they type there zip code and press submit it narrows down the search to jut their town/city or says wrong zip code or something.

Could someone help me? Please?
DaKKie is offline   Reply With Quote
Old 02-26-2008, 07:14 PM   PM User | #2
croatiankid
Regular Coder

 
croatiankid's Avatar
 
Join Date: Jan 2006
Posts: 665
Thanks: 1
Thanked 12 Times in 12 Posts
croatiankid is on a distinguished road
If you're asking how to make a dropdown list, like this:
<select>
<option>state1</option>
<option>state2</option>
</select>
__________________
Hrvoje
Croatiankid designs
Downtown host
croatiankid is offline   Reply With Quote
Old 02-26-2008, 07:28 PM   PM User | #3
DaKKie
New Coder

 
Join Date: Oct 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
DaKKie is an unknown quantity at this point
No I'm not. I know that part.

It's hard to ask in words. Uhh....

Code:
  <table width="360" height="137" border="0">
    <tr>
      <td height="29"><label></label>
        <form id="state" name="state" method="post" action="">
          <label><span class="style3">State</span>
          <select name="State" id="State" tabindex="1">
            <option selected="selected">Alabama</option>
            <option>Alaska</option>
            <option>Arizona</option>
            <option>Arkansas</option>
            <option>California</option>
            <option>Colorado</option>
            <option>Connecticut</option>
            <option>Delaware</option>
            <option>Florida</option>
            <option>Georgia</option>
            <option>Hawaii</option>
            <option>Idaho</option>
            <option>Illinois</option>
            <option>Indiana</option>
            <option>Iowa</option>
            <option>Kansas</option>
            <option>Kentucky</option>
            <option>Louisiana</option>
            <option>Maine</option>
            <option>Maryland</option>
            <option>Massachusetts</option>
            <option>Michigan</option>
            <option>Minnesota</option>
            <option>Mississippi</option>
            <option>Missouri</option>
            <option>Montana</option>
            <option>Nebraska</option>
            <option>Nevada</option>
            <option>New Hampshire</option>
            <option>New Jersey</option>
            <option>New Mexico</option>
            <option>New York</option>
            <option>North Carolina</option>
            <option>North Dakota</option>
            <option>Ohio</option>
            <option>Oklahoma</option>
            <option>Oregon</option>
            <option>Pennsylvania</option>
            <option>Rhode Island</option>
            <option>South Carolina</option>
            <option>South Dakota</option>
            <option>Tennessee</option>
            <option>Texas</option>
            <option>Utah</option>
            <option>Vermont</option>
            <option>Virginia</option>
            <option>Washington</option>
            <option>Washington D.C.</option>
            <option>West Virginia</option>
            <option>Wisconsin</option>
            <option>Wyoming</option>
          </select>
          </label>
        </form>
      </td>
    </tr>
<tr>
      <td height="29"><form id="zip" name="zip" method="post" action="">
        <label><span class="style3">Zip Code</span>
          <input name="zip" type="text" id="zip" tabindex="2" size="10" maxlength="5" />
          </label>
      </form>        <label></label></td>
    </tr>
    <tr>
      <td height="26"><form id="submit" name="submit" method="post" action="">
        <label>
          <input type="submit" name="submit" id="submit" value="Submit" tabindex="3" />
          </label>
      </form>
        <label></label></td>
    </tr>
  </table>
Now from there with the pull down text area and button. I the user to be able to choose a state and then type in their zip code and show a certain page.

Last edited by DaKKie; 02-26-2008 at 07:30 PM..
DaKKie is offline   Reply With Quote
Old 02-26-2008, 08:18 PM   PM User | #4
meth
Regular Coder

 
meth's Avatar
 
Join Date: Jan 2003
Posts: 262
Thanks: 0
Thanked 9 Times in 9 Posts
meth is on a distinguished road
OK, you have the form. It looks fine. However you have not stated (i)what query you are going to search with and (ii)how state and zip are intended to filter results. It would also be handy to see the relevant database table structures.
__________________
I do Web Design, Brisbane based.
More time spent in PHP/MySQL Web Development.
And Search Engine Optimisation takes up the rest of it.
meth is offline   Reply With Quote
Old 02-26-2008, 08:25 PM   PM User | #5
DaKKie
New Coder

 
Join Date: Oct 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
DaKKie is an unknown quantity at this point
Ok well what I'm trying to figure out is the best way, starting with the form.

What I want to search is certain cars in the cities/towns from the state. So say I'm looking for a Acura RSX 2005, and I live in NY and my zip is whatever one of their zip codes are. I pull down to New York and type my cities zip in. and it finds all the Acura RSX in that city, and I'll go on later to maybe add miles away from that zip and so on. So I just need to know the best way to do it.
DaKKie is offline   Reply With Quote
Old 02-26-2008, 11:15 PM   PM User | #6
meth
Regular Coder

 
meth's Avatar
 
Join Date: Jan 2003
Posts: 262
Thanks: 0
Thanked 9 Times in 9 Posts
meth is on a distinguished road
So, you haven't designed a database yet?
__________________
I do Web Design, Brisbane based.
More time spent in PHP/MySQL Web Development.
And Search Engine Optimisation takes up the rest of it.
meth is offline   Reply With Quote
Old 02-28-2008, 03:36 PM   PM User | #7
DaKKie
New Coder

 
Join Date: Oct 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
DaKKie is an unknown quantity at this point
No, I haven't done anything except what you see above. because I'm trying to figure out the best way of doing this.
DaKKie is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:46 PM.


Advertisement
Log in to turn off these ads.