Search code examples
htmlformsaction

In 'form action="?login"', what does the question mark mean?


Consider:

<form action="?login" method="post">     <button>Login with Google</button> </form>

I usually see the action refer to a PHP or HTML file, but the "?login" stumps me.

Background information:

This is buried within the example-google.php file from lightopenid framework. I've been staring at the OpenID code to use Google as a third-party OpenID provider for user login on my web site and the sample code all works.

I am trying to get a clearer picture of what the framework is doing when the user presses the login button. I know that we must be sending a bunch of arguments to Google on this button action, but the ?login doesn’t seem to point anywhere.

http://gitorious.org/lightopenid


Solution

  • A question mark denotes the query string.

    It will post to the current URL with a query string parameter of login. I am not sure how you are processing the request after you click submit (post the form), but usually it would have a value assigned to it as in login=value.