Yesterday provides an interface to the app side to query the user's harvest address
This interface is referred to the original other application interface files written out, the test will always pass my verification (verify the phone-side cookie and Phpcookie comparison. )
Think of the solution, found that the cookie can not be obtained, ask the great God, and then see the app request file Discovery request interface with file_get_contents. In that case, I can't get a cookie for his app, and then change to curl request and put the app's cookie into the header message
$ch = Curl_init ();
curl_setopt ($ch, Curlopt_url, the address to be requested);
curl_setopt ($ch, Curlopt_returntransfer, 1);
curl_setopt ($ch, Curlopt_get, 1); Post,get Past
$header []= ' ACCEPT-LANGUAGE:ZH-CN ';
$header []= ' user-agent:mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;. NET CLR 2.0.50727) ';
$header []= ' Host:my.xcar.com.cn ';
$header []= ' connection:keep-alive ';
$header []= ' cookie:php gets the name = '. $_cookie[' local name '];
curl_setopt ($ch, Curlopt_httpheader, $header); Put in the header information
$filecontent = curl_exec ($ch);
This will allow the cookie to take over so that PHP gets it.
This problem solved, but the app also said there is a mistake, I looked under, the original is my parameter filter but rigorous, immediately patched.
Summarize:
1. There is a problem with the app request.
2, my code is not rigorous.
3. The woman who wrote the app wrote it wrong.
2014-03-12
From the Baidu Space migration
Data interoperability between the app side and the PHP side