简体   繁体   English

如何通过PHP登录到另一个站点

[英]how to login to another site via PHP

I wanted to find out how to login to another site via PHP... I don't know the proper term for it, but basically, I want a user to be able to enter their login information for another website on mine, and interact with it through mine.Is there any tutorial?我想知道如何通过 PHP 登录到另一个站点...我不知道它的正确术语,但基本上,我希望用户能够输入我的另一个网站的登录信息,并进行交互通过我的。有教程吗? thanks谢谢

There are few ways to do the job (actually, you just need to send POST data to the other site).有几种方法可以完成这项工作(实际上,您只需要将 POST 数据发送到另一个站点)。

You can use :您可以使用:

curl will do that PHP, cURL post to login to WordPress curl 将执行PHP、cURL 发布以登录 WordPress

but you will need that installed on the server which is sometimes not an option.但是您需要在服务器上安装它,这有时不是一个选项。 There is however loads of scripts that can do the same thing as curl without the curl libs installed, eg: cakephp's HttpSocket class然而,有大量脚本可以在不安装 curl 库的情况下执行与 curl 相同的操作,例如:cakephp 的 HttpSocket 类

as already stated, Curl will do that.如前所述,Curl 会做到这一点。 But you can also check out this PHP Class that makes everything easier and gives you a lot of automation out of the Box Including Prefilling of CSRF Token, finding of all input fields, retrieving of details from the designated site.但是您也可以查看这个 PHP 类,它使一切变得更容易,并为您提供了很多开箱即用的自动化,包括预填充 CSRF 令牌、查找所有输入字段、从指定站点检索详细信息。 etc the class can be found Here.等课程可以在这里找到。 Crawl Engine爬行引擎

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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