一直听说php curl模拟登陆,但一直不知道什么意思?是将本网站的用户名和密码,通过socket发送到另一个网站实现登陆吗?求详解.......curlphp模拟登陆

解决方案 »

  1.   

    将本网站的用户名和密码,通过socket发送到另一个网站实现登陆
    这个是SSO
    也是模拟登陆的一种模拟登陆是将用户名和密码,通过socket发送到网站实现登陆
      

  2.   

    模擬登陸的步驟:
    $url ='你的登陸頁面';
    $user_login='';
    $user_password='';
    $loginfields = "user_login=$user_login&user_password=$user_password";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_POST, 0); //set how many paramaters to post
    curl_setopt($ch, CURLOPT_URL,$url); //set the url we want to use
    curl_setopt($ch, CURLOPT_POSTFIELDS,$loginfields); //set the field 
    $data = curl_exec($ch); //execute and get the results
    curl_close ($ch);
    通過訪問網站外的php,模擬有人填寫了用戶名和密碼,然後提交給系統.