Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Manually putting variables in URL from html form

    Hey guys,

    This is a stupid question and ive looked at it for an hour and just cant get it.

    You know when you have post variables from a HTML form in the URL bar...so like Create Tests for Organizational Training and Certification Programs – Test.com

    How do you do that manually when its an Option from a drop down box in a form.

    So for example:

    Code:
    <form method="POST" action="http://www.test.com/test.php"></form>
    <tbody>
    <tr class="whitebg">
    <td width="56" valign="MIDDLE" height="20" align="RIGHT">
    <td width="150" valign="MIDDLE" height="20" align="CENTER">
    <span class="black">
    <select class="switch" name="aliasid">
    <option selected="" value="1456"> Name</option>
    </select>
    </span>
    </td>
    <td width="38" valign="MIDDLE" height="20" align="CENTER">
    <input class="switch" type="SUBMIT" value="Go!" name="switch">
    So ive tried like:
    Create Tests for Organizational Training and Certification Programs – Test.com
    Create Tests for Organizational Training and Certification Programs – Test.com

    I just cant get it to work manually through the browser url bar and it seems to be because its a option select for a drop down.

    Any ideas where i got it wrong.

  • #2
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    sorry what ive tried should be:
    Code:
    www.test.com/test.php?name=aliasid&value=1234
    www.test.com/test.php?value=1234

  • #3
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,303
    Thanks
    23
    Thanked 612 Times in 611 Posts
    For a form to pass values in the url you have to use the GET method not the post method which hides the values.
    Code:
    <form method="GET" action="http://www.test.com/test.php">
    <select name="name">
    	<option value="">select a name</option>
    	<option value="aliassam">Sam</option>
    	<option value="aliasid">Bill</option>
    	<option value="aliashome">Tammy</option>
    </select>
    <select name="value">
    	<option value="">choose a value</option>
    	<option value="1222">Sam</option>
    	<option value="1423">Bill</option>
    	<option value="1234">Tammy</option>
    </select>
    
    <input type="submit" value="Submit" >
    </form>
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •