0

我正在尝试通过在此处提交此表单来获取数据

点击“城镇”会出现一个表格。

虽然我可以得到数据,但它是一个 500 个错误页面,我已经挣扎了 5 个小时和我的代码

$url = 'http://services2.hdb.gov.sg/webapp/BR12AWRentalEnquiry/BR12PSearch.faces';
$fields['searchByTown:frmSearchByTown']='searchByTown:frmSearchByTown';
$fields['searchByTown:frmSearchByTown:selTown']='AMK';
$fields['searchByTown:frmSearchByTown:txtBlkFrm']=1;
$fields['searchByTown:frmSearchByTown:txtBlkTo']=10;
$fields['searchByTown:frmSearchByTown:dteStart1']="Jul 2013";
$fields['searchByTown:frmSearchByTown:dteEnd1']="Oct 2013";
$fields['avax.faces.ViewState']='j_id1:j_id3';

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_POST      ,1);
curl_setopt($ch, CURLOPT_POSTFIELDS    ,$fields);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION  ,1);
curl_setopt($ch, CURLOPT_HEADER      ,0); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER  ,1);  
$data = curl_exec($ch);
curl_close($ch);

有人发现问题吗?

4

0 回答 0