How does php parse the data client after jqueryserialize is submitted to submit form data through jquery serialize?
$ ("# Submit_survey "). click (function () {$. post (SITE_URL + 'activity/survey/savesurvey ', {data: $ (' # survey_form '). serialize ()}, function (response) {if (response. error_code) {infotips (response. msg, $ ('. submit_tips ');} else {infotips ('saved successfully', $ ('. submit_tips '), 'right') ;}, 'json'); return false ;});
The data post to the php end is:
Title = % E6 % 82% A8 % E5 % 8F % AF % E4 % BB % A5 % E5 % 9C % A8 % E8 % BF % 99% E9 % 87% 8C % E5 % 88% 9B % E5 % BB % BA % E6 % 82% A8 % E7 % 9A % 84% E9 % 97% AE % E7 % AD % 94% E9 % A2 % 98% E7 % 9B % AE % EF % BC % 8C % E5 % 90% 8C % E6 % 97% B6 % E5 % AF % B9 % E9 % 97% AE % E7 % AD % 94% E6 % B4 % BB % E5 % 8A % a8 % E5 % 8A % A0 % E4 % BB % A5 % E8 % AF % B4 % E6 % 98% 8E & cover_image = & file_name = & file_partpath = & description = & isgender = 0 & isarea = 0 & isage = 0 & question % 5B1% 5D = ghk & option % 5B1% 5D % 5B0% 5D = hgkhk & option % 5B1% 5D % 5B1% 5D = hkhj & option % 5B1% 5D % 5B2% 5D = khgkhk & option % 5B1% 5D % 5B3% 5D = & question % 5B2% 5D = hgkh & option % 5B2% 5D % 5B0% 5D = hkhjk & option % 5B2% 5D % 5B1% 5D = hjkhjl & option % 5B2% 5D % 5B2% 5D =
How to replace it with the correct format:
Array
(
[Title] => dsgd
[Cover_image] => hdsgdsg
[File_name] => 219_20130514170542.jpg
[File_partpath] =>
[Description] =>
[Isgender] => 0
[Isarea] => 0
[Isage] => 0
[Question] => Array
(
[1] => dgdg
)
[Option] => Array
(
[1] => Array
(
[0] => aa
[1] => bb
[2] => cc
)
)
)
Reply to discussion (solution)
No, right? Is jq so mentally retarded ?!
Submit and process the template as normal.
If it is as you said, parse_str is prepared for this purpose. of course, you need to use urldecode to parse the code first.
$. Post does not require {data: $ (form). serialize ()}, but $ (form). serialize ().
Maybe because of this, the independent input values have been changed to the string type values of data.
$. Post does not require {data: $ (form). serialize ()}, but $ (form). serialize ().
Maybe because of this, the independent input values have been changed to the string type values of data.
Yes, thanks.
No, right? Is jq so mentally retarded ?!
Submit and process the template as normal.
If it is as you said, parse_str is prepared for this purpose. of course, you need to use urldecode to parse the code first.
I used the error.