Cainiao asked me some basic questions. does php support saving my code as a php file and uploading a single php file to a space? Thank you !! At last, this post was edited by qbnrg968119 from 2013-11-2620: 00: 48. the code for signing in is as follows, I can ask some basic questions about the following code. Is it possible for php to save my code as a php file and then upload a single php file to the space? Thank you !!
At last, this post was edited by qbnrg968119 at 20:00:48 on. a simple code for signing in is as follows: I want to upload the code to the Baidu BAE space. I can save the following code as a php file and package it, is this single PHP file uploaded? Or do I have to write other code and other files to work?
I tried it and uploaded it to the Baidu BAE space. after I uploaded the zip file, it will report an error:
Parse error: syntax error, unexpected T_STRING in code/builder/work/appidwihbq31d16/0/uxinsign. php on line 7
Errors parsing code/builder/work/appidwihbq31d16/0/uxinsign. php
Is there an error in the code itself?
Cainiao has never done network programming and has only done desktop software. php does not understand it at all. thank you very much !!
Header ("Content-type: text/html; charset = UTF-8 ");
$ Id = $ _ GET ["id"];
$ Pw = $ _ GET ["pw"];
If ($ id! = ''){
? ?? ??? $ Rang = revert (300,777 );
? ?? ??? $ Ch = curl_init ("im.uxin001.com: 8887/login? Sn = ". $ rang. "& account = ". $ id. "& pwd = ". md5 ($ pw ). "& pv = android & v = 1.7.1 & sign = ". md5 ($ rang. $ id. "k1oET & Yh7 @ EQnp2XdTP1o/Vo = "). "& netmode = 3 & brand = samsung & model = GT-I9100 & osv = 2.3.4 & imei = ". rand (Random, 99999 ). rand (Random, 99999 ). rand (Random, 99999 ));
? ?? ??? Curl_setopt ($ ch, CURLOPT_HEADER, 1 );
? ?? ??? Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, true );
? ?? ??? $ Cont = curl_exec ($ ch );
? ?? ??? List ($ head, $ body) = explode ("\ r \ n", $ cont );
? ?? ??? Preg_match ("/set \-cookie [^ \ r \ n] *)/I", $ head, $ matches );
? ?? ??? $ Cookie = $ matches [1];
? ?? ??? Curl_close ($ ch );
? ?? ??? If (strstr ($ body, ': 0 }')){
? ?? ?? ?? ?? ? Echo $ id. "---- logon successful ----";
? ?? ???} Else {
? ?? ?? ?? ?? ? Echo $ id. "---- logon failed ----";
? ?? ???}
? ?? ??? $ Rang = revert (333,999 );
? ?? ??? $ Ch_2 = curl_init ("im.uxin001.com: 8887/signin? Sn = ". $ rang." & sign = ". md5 ($ rang." k1oET & Yh7 @ EQnp2XdTP1o/Vo = "));
? ?? ??? Curl_setopt ($ ch_2, CURLOPT_HEADER, 0 );
? ?? ??? Curl_setopt ($ ch_2, CURLOPT_RETURNTRANSFER, true );
? ?? ??? Curl_setopt ($ ch_2, CURLOPT_COOKIE, $ cookie );
? ?? ??? $ Content = curl_exec ($ ch_2 );
? ?? ??? Curl_close ($ ch_2 );
? ?? ??? If (strstr ($ content, '\ u6210 \ u529f ')){
? ?? ?? ?? ?? ? Echo "check in successful ";
? ?? ???} Else {
? ?? ?? ?? ?? ? Echo "failed to sign in ";
? ?? ???}
} Else {
Echo "the mobile phone number or password cannot be blank! ";
}
?>
Share:
------ Solution --------------------
I don't know how your code is entered.
Remove the leading blank from Line 1!
------ Solution --------------------
No error was reported after testing.
------ Solution --------------------
It may be that your file contains the BOM header, so