所以我使用php从file_get_contents
的URL检索页面HTML。该网站加载正常和一切,但登录字段不起作用。无论如何使用这种方法登录?
不知道它有用,但这是登录表单。
<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 / 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=/recovery">
Forgot your password?
</a>
<button type="submit" class="yui3-button yui3-u">
Sign in
</button>
</div>
</form>
答案 0 :(得分:0)
所以你的问题似乎有点不清楚,但可以理解。使用php检索代理数据时,使用CURL
而不是file_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;
这样您的代理将检索数据
注意:如果您希望将所有CURL
更改为file_get_contents
,但我强烈建议您使用CURL