所以我有一个网站http://example.com 还有一个网站我想登录; http://target.com 我想要一个脚本,可以填写登录表单(用户名和密码)在http://target.com从我的网站。从其他网页使用PHP登录网站
所以当上http://example.com/login.php&username=John&password=12345
用户点击他应该登录http://target.com直接发送到欢迎页面。
我得到了这段代码;
$url = "http://target.com";
$post = "username=John&password=12345&login=++Ba%F0lan++";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
echo curl_exec($ch);
curl_close($ch);
但它没有转发我到欢迎页面。相反,它显示我在http://example.com(页面未找到)上的错误
它也没有从url获取用户名和密码数据。但我想我会在稍后自行解决。
任何帮助?
对我来说,它看起来像钓鱼脚本。 – Peter