0

Here's the code I'm currently using for my form:

<form method="post" action="access.php" class="form-stacked">

    <fieldset class="control-group">

        <div class="control-group">
            <div class="controls">
                <input class="input-xlarge" name="s1" id="s1" type="text" value="" />
            </div>
          </div>
          <center>(click here if you need help finding your username)</center>

    </fieldset>

    <fieldset class="control-group">

        <div class="control-group">
            <div class="controls">
                <input class="input-xlarge" name="s2" id="s2" type="text" value="" />
            </div>
          </div>
          <center>(click here if you need help finding your username)</center>

    </fieldset>

</form>

When I click enter it takes people directly to http://mysite.com/access.php

But instead I'm trying to figure out how to make it take them to http://mysite.com/access.php?s1=value&s2=value

Obviously the value would be replaced with the text they actually entered. What's the easiest way for me to change this code to make it happen?

Thanks!

1
  • 7
    change method="post" to method="get" Commented Sep 1, 2013 at 0:29

3 Answers 3

2

Have a read at Architecture of the World Wide Web, Volume One and URIs, Addressability, and the use of HTTP GET and POST by W3C.

Change method="POST"

to

method="GET"

Sign up to request clarification or add additional context in comments.

Comments

0

from method="POST" to method="GET"
thats all

Comments

0

The following code should work just fine. But note that you shouldn't do this if the user is inputting sensitive data like passwords, credit card information, etc.

<form method="get" action="access.php" class="form-stacked">

<fieldset class="control-group">

    <div class="control-group">
        <div class="controls">
            <input class="input-xlarge" name="s1" id="s1" type="text" value="" />
        </div>
      </div>
      <center>(click here if you need help finding your username)</center>

</fieldset>

<fieldset class="control-group">

    <div class="control-group">
        <div class="controls">
            <input class="input-xlarge" name="s2" id="s2" type="text" value="" />
        </div>
      </div>
      <center>(click here if you need help finding your username)</center>

</fieldset>

Comments