20,359
社区成员
发帖
与我相关
我的任务
分享
$name='lisa'; //从 我的网站aa.com 提交的用户名
$pass='pass'; //从我的网站aa.com获取的密码
$post_data=array(
'UNAME'=>$name,
'PASSWORD'=>$pass
);
$url='http://oa.com/logincheck.php'; //模拟提交的oa.com的post接受地址
$postdata = http_build_query($post_data);
$options = array( //模拟浏览器信息
'http' => array(
'method' => 'POST',
'header' => 'Content-type:application/x-www-form-urlencoded',
'content' => $postdata,
'timeout' => 15 * 60 // 超时时间(单位:s)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
/*
这里的 $result 如果成功以后会自动跳转到 oa.com/user 我不想要跳转,
如果成功了我想要跳转到 aa.com/user 我不知道怎么处理了。
*/