2013-12-12 20 views
1

因此,我使用php從URL中檢索頁面HTML,使用file_get_contents。該網站加載罰款和一切,但登錄領域不會工作。無論如何使用這種方法登錄?在使用代理服務器時登錄站點

不知道它有幫助,但這裏是登錄表單。

<form class="login-panel async-form" method="post">  
     <div class="yui3-g"> 
      <label class="email yui3-u-1-2"> 
       <input 
        type="text" id="email" name="email" value="" 
        placeholder="E-mail &#x2F; Account Name" autofocus required /> 
      </label> 

      <label class="password yui3-u-1-2"> 
       <input 
        type="password" id="password" name="password" value="" 
        placeholder="Password" required /> 
      </label> 
      <br /> 

      <a class="login-reset yui3-u" href="https://yummmmmm-c9-veloncia.c9.io/plawy.php?id=&#x2F;recovery"> 
       Forgot your password? 
      </a> 



      <button type="submit" class="yui3-button yui3-u"> 
       Sign in 
      </button> 
     </div> 
    </form> 

回答

0

所以你的問題似乎有點不清楚,但可以理解。當使用PHP來檢索代理的數據使用CURLfile_get_contents

 $url  = "http://randomplacedd.com/url-to-post-data-to"; 
$postfields = "var1=data&var2=data"; 
$password = "password" 

$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_USERPWD, $password); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); 
$response = curl_exec($ch); 

echo $response; 

這樣,你的代理將檢索數據

注:如果你想雖然你可以改變所有的CURLfile_get_contents,但我強烈建議使用CURL

相關問題