Flowchart
Image Upload reference blog
For more information about image uploading, see. The basic process is the same. You have modified some methods suitable for this function. Reference source code
Plug-in list
1. JQUERY plug-in
2. Select imgareaselect as the client image.
3. uploadify upload function
4. piphp_uploadfile.php uploads files
5. piphp_imagecrop.php Image
Image uploading and resume Summary
1. When an image is uploaded, a timestamp is input and a specific character is appended. md5 encryption is used to obtain the unique name of the cache file. After the resume is entered, the file will be deleted.
2. ajax transmission,
Json Data Format
Var eduField = {
'Resume _ idcard ':'',
'Resume _ EDU_STARTDATE ':'',
'Resume _ EDU_ENDDATE ':'',
'Resume _ EDU_SCHOOL ':'',
'Resume _ EDU_TEL ':''
}
After JSON. stringify (eduField) Parsing
Can be submitted to the background by ajax
$. Ajax ({
Type: "POST ",
Url: "resume_save.php ",
Data: data
BeforeSend: function (){
$ ("# Submit"). attr ("disabled", true). val ("submit... ");
},
Success: function (data ){
Var jsonresult = JSON. parse (data); // parses the background json format back to the object. You can directly point out the property value or obtain the value jsonresult ['key'] in an array-like way.
..........
Jsonresult. step
}
});
Retrieve data parsing in the background
Stripslashes removes the escape characters in the data from the reverse definition \
Parse the json data
Json_decode (stripslashes ($ _ REQUEST ['data']);
The data is an object.
Encode the background arrary or object data and return it to the front-end page
Json_encode ($ jsonarr );
Reception data
JSON. parse (data)
Read data
3. gbk and utf8 Encoding Problems. Www.2cto.com
Iconv ("gb2312", "UTF-8 // IGNORE", $ data); // gb2312-> UTF-8 here // IGNORE indicates an error message indicating the conversion is ignored. As for why there are many google websites.
4. Some form verification to prevent database injection and Other filtering.