我只想通过php填写aspx页面中的表单。可能吗?我尝试了一些卷曲代码,但没有工作。谢谢你的回答。
$url = 'somepage.aspx';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_COOKIEJAR, $ckfile);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data['button_name'] = "button_value";
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output=@curl_exec($ch);
$info = @curl_getinfo($ch);
if(curl_errno($ch)){
echo 'Curl error: ' . curl_error($ch);
}
curl_close($ch);
echo "output is:'" . $output . "'";
echo "<br>";
echo "info is:";
print_r($info);