简体   繁体   中英

How to create a link in a site that will login another site?

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.

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM