我有点问题,
这是我的卷曲功能:
function file_get_contents_curl($url) {
$ch = curl_init($url);
if (isset($_SESSION['user']) && isset($_SESSION['password']))
{
$log = array(
'login' => $_SESSION['user'],
'password' => $_SESSION['password'],
'remind' => 'on'
);
curl_setopt($ch, CURLOPT_POST, count($log));
curl_setopt($ch, CURLOPT_POSTFIELDS, $log);
}
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.pt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.pt");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$data = curl_exec($ch);
curl_close($ch);
return $data;}
但$ data的结果是原始的$ url(日志页面),为什么我无法记录我在$ log中传递的信息?
正确键入POST表单目标。我不明白
有关信息,$ url是我学校的内部网,我需要$ data(loggued ofc)来预设一些信息。
$ url的形式是基本的:
<form method="post" action="">
<fieldset>
<legend>Connexion</legend>
<div class="login input">
<label for="auth-input-login">Login</label>
<input type="text" id="auth-input-login" name="login" placeholder="Login" />
</div>
<div class="password input">
<label for="auth-input-password">Mot de passe</label>
<input id="auth-input-password" name="password" placeholder="Mot de passe" type="password" />
</div>
<div class="remind input">
<input id="auth-input-remind" name="remind" type="checkbox" />
<label for="auth-input-remind">Se souvenir de moi</label>
</div>
</fieldset>
<div class="submit">
<input type="submit" value="Se connecter" />
</div>
</form>
发布结果: http://s22.postimg.org/ta6kivcep/Screen_Shot_2014_05_21_at_15_38_21.png