Now there is such a demand,
This is the information that I return from the form post number and key to a logistics company interface, how do I read the time, status, and other information in PHP or jquery and then display it on another HTML page? Urgent!!!
Reply content:
Now there is such a demand,
This is the information that I return from the form post number and key to a logistics company interface, how do I read the time, status, and other information in PHP or jquery and then display it on another HTML page? Urgent!!!
Http://www.runoob.com/php/func-simplexml-load-string.html
Http://www.w3school.com.cn/jquery/ajax_ajax.asp
---update---
If it is not possible to submit directly to the logistics site with Ajax (JSONP is rarely supported, it is impossible to submit the past.) )
Using a form to submit to your PHP program, the PHP program constructs the request content, curl requests to the logistics site, receives the returned XML, and parses the processing.
Or if the interface of the Logistics Web site supports the asynchronous return of the results can also.
Do you want to ask how to send HTTp requests in PHP?
function send_post($url, $post_data) { $postdata = http_build_query($post_data); $options = array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type:application/x-www-form-urlencoded', 'content' => $postdata, 'timeout' => 15 * 60 // 超时时间(单位:s) ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); return $result; }
The above return value is the XML content above. Specific interfaces do not know, you can not write an example.
JQuery even if this is a cross-domain interface and does not support JSONP
Recommended for PHP Processing: PHP processing XML