在'form action="?login"'中,问号是什么意思? [英] In 'form action="?login"', what does the question mark mean?

查看:68
本文介绍了在'form action="?login"'中,问号是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑:

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

我通常看到 action 指的是 PHP 或 HTML 文件,但?login"却没有.难倒我了.

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

背景信息:

这隐藏在 lightopenid 框架的 example-google.php 文件中.我一直在关注 OpenID 代码,以将 Google 用作第三方 OpenID 提供商,以便用户在我的网站上登录,并且示例代码一切正常.

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.

我试图更清楚地了解当用户按下登录按钮时框架正在做什么.我知道我们必须在这个按钮操作上向 Google 发送一堆参数,但是 ?login 似乎没有指向任何地方.

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

推荐答案

问号表示查询字符串.

它将使用 login 的查询字符串参数发布到当前 URL.我不确定您在单击提交(发布表单)后如何处理请求,但通常它会分配一个值,如 login=value 中所示.

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.

这篇关于在'form action="?login"'中,问号是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆