Php uploads the file phpjson //////////////////////////////////// //////////////////////////
Upload files in php
Sample php can be in my programming Diary: http://cffile.sinaapp.com /? Download in p = 145
Open php. ini, first find
;;;;;;;;;;;;;;;;
; File Uploads;
;;;;;;;;;;;;;;;;
Region, which has the following parameters that affect file upload:
File_uploads = on; whether to allow file upload over HTTP. ON is enabled by default.
Upload_tmp_dir; upload the file to the place where the temporary file is stored on the server. if it is not specified, the default temporary folder will be used.
Upload_max_filesize = 8 m; maximum file size allowed to be uploaded. The default value is 2 MB.
Php. ini in wamp is in Apache2 \ bin \ php. ini
//////////////////////////////////////// ////////////////////
Php json
/***************/
Php in the background:
Class PkRes
{
Var $ pkState;
Var $ id;
}
$ PkRes = new PkRes;
$ PkRes-> pkState = 'win ';
$ PkRes-> id = '123 ';
Echo json_encode ($ pkRes );
/******************/
Front-end analysis:
All languages are supported. js parsing is provided here.
// Data is the data transmitted from the background
Var pkRes = eval ('+ data + ')');
Alert (pkRes. pkState );
Alert (pkRes. id );
Full text see my programming diary http://cffile.sinaapp.com /? P = 145