如何在将登录其他网站的网站中创建链接? [英] How to create a link in a site that will login another site?
问题描述
有一个简单的网站,我们称之为 http://foo.com/ ,用简单的用户/将发布请求的表单发送到 http://foo.com/login.php 以登录用户。
There is a simple site, let's call it http://foo.com/ , with a simple user/pass form that sends a post request to http://foo.com/login.php to login the user.
如何在其他网站上创建链接,比如 http:// foo_autologin.com/ ,将使用 http://foo.com/并在另一个标签中打开,登录?
How to create a link in another site, say http://foo_autologin.com/ , that will login with a pre-determined password on http://foo.com/ and open it, logged in, in another tab?
推荐答案
您可以 http:// foo_autologin.php
(不一定是php,可以是html)使用Javascript打开一个新窗口,指向一个名为proxy_login.php的文件或其他东西。然后使用CURL将登录凭据发布到 http://foo.com
。结帐卷曲文档并查看示例。
You can have http://foo_autologin.php
(doesn't have to be php, can be html) use Javascript to open a new window pointed to a file called proxy_login.php or something. Then use CURL to post the login credentials to http://foo.com
. Checkout Curl Documentation and look in the examples.
这篇关于如何在将登录其他网站的网站中创建链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!