我本周试图通过使用php curl并向服务器提供IBAN列表来自动执行所有银行转账,因此它可以直接添加IBAN,而不是分别在同一列表中为每个IBAN定义的转账金额。至于现在,我可以使用PHP CURL登录到银行网站,通过发布我的浏览器会做的相同请求,我到目前为止唯一的问题是,当我尝试通过重播相同的请求添加IBAN服务器似乎忽略我发布的所有数据,只是发回一个页面来填充信息而不指定是否有错误,它应该返回一页确认。我的银行没有免费提供这样的任何解决方案,唯一的解决方案是将此提供给我的银行,这需要一周的时间才能完成,所以我必须自己动手。
这是浏览器发送的帖子数据:
22:50:29.852[532ms][total 532ms] Status: 303[See Other]
POST https://----------------- Load Flags[LOAD_DOCUMENT_URI LOAD_INITIAL_DOCUMENT_URI ] Content Size[0] Mime Type[text/html]
Request Headers:
Host[]
User-Agent[Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:48.0) Gecko/20100101 Firefox/48.0]
Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
Accept-Language[en-US,en;q=0.5]
Accept-Encoding[gzip, deflate, br]
DNT[1]
Referer[]
Cookie[]
Connection[keep-alive]
Post Data:
dialogActionPerformed[NEXT]
taskOID[0153b9d514b35d5c837b347dd88e2e68db91]
taskInfoOID[creerBenef]
screenName[ibp.cd.qbel.abocrb10affgestben.screen_HTML_INTERNET%3AAffGestBen.CreerModifBenef]
validationStrategy[AV]
formModified[true]
token[9e72005db5c4d37a5ab76cc681e30fb8d6]
beneficiaire.nom[denis+turq]
attribute%28%24SEL_%24lst1%29[*NEW*]
attribute%28%24SEL_%24lst1_hidden%29[lst1%24listeGroupes%24beneficiaire.groupe%24]
groupeACreer.nom[Virementafaire]
attribute%28%24SEL_CODE_%24clm1%29[VD]
attribute%28%24SEL_CODE_%24clm1_hidden%29[clm1%24groupeACreer.nature%24]
beneficiaire.matricule[]
beneficiaire.adresseBenef1[]
beneficiaire.adresseBenef2[]
beneficiaire.adresseBenef3[]
beneficiaire.email[]
attribute%28%24SEL_CODE_%24lst3%29[000]
attribute%28%24SEL_CODE_%24lst3_hidden%29[lst3%24beneficiaire.cboPaysBanque%24]
beneficiaire.IBAN9.IBAN_part1[FR34]
beneficiaire.IBAN9.IBAN_part2[3000]
beneficiaire.IBAN9.IBAN_part3[2040]
beneficiaire.IBAN9.IBAN_part4[4700]
beneficiaire.IBAN9.IBAN_part5[0005]
beneficiaire.IBAN9.IBAN_part6[8434]
beneficiaire.IBAN9.IBAN_part7[J16]
Response Headers:
Date[Sun, 27 Mar 2016 20:50:30 GMT]
Server[IWS]
Strict-Transport-Security[max-age=31536000]
Pragma[no-cache]
Cache-Control[no-cache,no-store]
Expires[-1]
Location[/cyber/internet/ContinueTask.do?taskOID=0153b9d514b35d5c837b347dd88e2e68db91&screenName=ibp.cd.qbel.abocrb10affgestben.screen_HTML_INTERNET%3AAffGestBen.CreerModifBenef&dialogActionPerformed=NEXT&token=9e72005db5c4d37a5ab76cc681e30fb8d6]
Content-Length[0]
Content-Type[text/html; charset=iso-8859-15]
Content-Language[fr-FR]
Keep-Alive[timeout=8, max=300]
Connection[Keep-Alive]
这是我用来重播相同帖子请求的代码:
$nom=urlencode("denis turq");
$iban="FR34 3000 2040 4700 0005 8434 J16";
$list = explode(" ", $iban);
$postdata="dialogActionPerformed=NEXT&taskOID=". $html->find('input',1)->value ."&taskInfoOID=creerBenef&screenName=ibp.cd.qbel.abocrb10affgestben.screen_HTML_INTERNET%3AAffGestBen.CreerModifBenef&validationStrategy=AV&formModified=true&token=".$html->find('input', 6)->value ."&beneficiaire.nom=". $nom ."&attribute%28%24SEL_%24lst1%29=*NEW*&attribute%28%24SEL_%24lst1_hidden%29=lst1%24listeGroupes%24beneficiaire.groupe%24&groupeACreer.nom=Virementafaire&attribute%28%24SEL_CODE_%24clm1%29=VD&attribute%28%24SEL_CODE_%24clm1_hidden%29=clm1%24groupeACreer.nature%24&beneficiaire.matricule=&beneficiaire.adresseBenef1=&beneficiaire.adresseBenef2=&beneficiaire.adresseBenef3=&beneficiaire.email=&attribute%28%24SEL_CODE_%24lst3%29=000&attribute%28%24SEL_CODE_%24lst3_hidden%29=lst3%24beneficiaire.cboPaysBanque%24&beneficiaire.IBAN9.IBAN_part1=". $list[0]."&beneficiaire.IBAN9.IBAN_part2=". $list[1]."&beneficiaire.IBAN9.IBAN_part3=". $list[2]."&beneficiaire.IBAN9.IBAN_part4=".$list[3] ."&beneficiaire.IBAN9.IBAN_part5=".$list[4] ."&beneficiaire.IBAN9.IBAN_part6=". $list[5]."&beneficiaire.IBAN9.IBAN_part7=". $list[6];
$url="https://------------------";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$request_headers = array();
$request_headers[] = 'DNT: 1';
$request_headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
$request_headers[] = 'Content-Type: application/x-www-form-urlencoded';
curl_setopt($ch, CURLOPT_HTTPHEADER, $request_headers);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 50);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_COOKIEFILE, realpath('./cookies/'.$cookie));
curl_setopt($ch, CURLOPT_COOKIEJAR, realpath('./cookies/'.$cookie));
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS, $postdata);
$data = curl_exec($ch);
我删除了主机,引荐来源和cookie,因为它们实际上是相同的,当我通过php更改发布数据中的任何变量的名称时,服务器返回错误,我可以通过私人消息提供我的团队查看器在极端条件下,如果问题似乎来自其他问题。
感谢您的帮助。