Using information from HTML form to direct to specific URL

Discussion in 'HTML & Website Design' started by dlm, Jan 14, 2010.

  1. #1
    Hi all,

    Not sure if I should have put this in the Javascript section, as I'm not sure if the solution to my problem requires it, but I thought I'd try hear first.

    Basically, I want to make a simple form that has 2 fields: first name & last name (I can do this part, lol).

    The hard part: when the user (for example James Smith) submits the form, I want them re-directed to the following page:
    http://example.net/?gasearching=1&recordtype=3&firstName=[B]James[/B]&lastName=[B]Smith[/B]&location=US
    Code (markup):
    ...where the visitor's first and last name get entered the proper fields depending on what information they entered into the form.

    Any help would be appreciated.
     
    dlm, Jan 14, 2010 IP
  2. OSchnapps

    OSchnapps Peon

    Messages:
    92
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    are you trying to Geo Target the users to a Geo specific website via IP address?
     
    OSchnapps, Jan 14, 2010 IP
  3. dlm

    dlm Peon

    Messages:
    3,123
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No geo-targeting required. The only variables are the one the user enters into the form (first name & last name)
     
    dlm, Jan 14, 2010 IP
  4. OSchnapps

    OSchnapps Peon

    Messages:
    92
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Well if the information is entered into a DB you could use PHP to call the first and last name variables and insert that into the URL,

    sounds like you may be looking for more then that though
     
    OSchnapps, Jan 14, 2010 IP
  5. dlm

    dlm Peon

    Messages:
    3,123
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Well that's what I'd like to do...but without the database.

    Looking into it, it looks like the PHP $_GET Function might be of use, but I don't have enough experience with PHP to get this working.
     
    dlm, Jan 14, 2010 IP
  6. OSchnapps

    OSchnapps Peon

    Messages:
    92
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    im the same way, i have a good general PHP base but i work with a PHP programmer, ill shoot him this link see if he can be of some help to you
     
    OSchnapps, Jan 14, 2010 IP
  7. goliath

    goliath Active Member

    Messages:
    308
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #7
    change the "method" property of the form from post to get

    this will cause the form data to be added to the url in the normal ?name=value&next=more style of a GET request.
     
    goliath, Jan 14, 2010 IP
    dlm likes this.
  8. dlm

    dlm Peon

    Messages:
    3,123
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    0
    #8
    :D

    Thank you. I actually figured this out on my own just as you were posting.

    + rep added
     
    dlm, Jan 14, 2010 IP