Php simulates post to obtain jsp query data. it uses curl. if there is a problem, please advise to use PHP to use curl to obtain jsp page query results.
The correct result should be (entered for query on the official website ):
The result of a piece of code I wrote (using curl) is as follows:
Code:
Somehow, the data I entered in the test is: invoice code: fpdm1 = 221011270133 invoice Serial Number: fphm1 = 06649746
However, the results returned by using curl are different from those found on the official website. please give me some advice. thank you!
Reply to discussion (solution)
Didn't he log on? Also install controls
Can you access it without logging in?
Well, you do not need to log on.
$url = 'http://218.25.48.198/jsp/fpzjcx/fpzjcx_jg.jsp';$ch = curl_init();curl_setopt($ch,CURLOPT_URL,$url);curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, 'fpdm1=221011270133&fphm1=06649746');curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);$data = curl_exec($ch);echo $data;
Shenyang local tax invoice lottery information inquiry system
| Query result |
Hello, congratulations, you have entered the 20,130,501st prize pool. you have participated in four lottery meetings. the lottery number starts from 221011270133066497460001 and the lottery number ends at 221011270133066497460004. The prize opening date is Wednesday of the second week of June 1, June 2013, I hope you will win the prize. |
|
That can be accessed only after logon.
Therefore, you must first simulate logon first.
Khan, how can I ask if I want to log on?
"An error occurred in the online tax return system. close your browser and log on again later !"
Yes. access http: // 218.25.48.198/jsp/fpzjcx/fpzjcx_jg.jsp directly.
Submitted.
"An error occurred in the online tax return system. close your browser and log on again later !"
Haha, it's successful. The reason why I cannot get the correct result is that the type passed by the parameter is incorrect.
Yes. access http: // 218.25.48.198/jsp/fpzjcx/fpzjcx_jg.jsp directly.
Submitted.
"An error occurred in the online tax return system. close your browser and log on again later !"
An error occurred while visiting the website.
I would like to express my gratitude for the final effect!
Please kindly advise me the same problem. I also need to simulate how the developer solves it. please attach my code.
$ Url = 'http: // cx.ytjj.gov.cn: 9081/ytjjvio/veh4tablevio. action? 444 ';
$ Post_data = array (
"Vehvio. hphm" => 'Lu fzj801 ',
"Vehvio. clsbdh" => '20140901 ',
"Vehvio. hpzl" => "02"
);
$ Ch = curl_init ();
// Set the URL and corresponding options
Curl_setopt ($ ch, CURLOPT_URL, $ url );
Curl_setopt ($ ch, CURLOPT_HEADER, 0 );
Curl_setopt ($ ch, CURLOPT_POST, 3); // Set it to POST
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, true );
Curl_setopt ($ ch, CURLOPT_POSTFIELDS, "vehvio. hphm = Lu FZJ801 & vehvio. clsbdh = 3235 & vehvio. hpzl = 02 ");
// Curl_setopt ($ ch, CURLOPT_ENCODING, "UTF-8"); // The key is here
// Capture the URL and pass it to the browser
$ Content = curl_exec ($ ch );
Echo $ content ."_";
Exit;
I want to simulate login to a jsp page. could you ask me some questions?