Client submits form data via 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 (' Save succeeded ', $ ('. Submit_tips '), ' right '); } }, ' json '); return false; });
The data to post to on the PHP side 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 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 way? JQ so retarded?!
Submit the processing to the normal standard version.
If it's really what you say, then PARSE_STR is prepared for this, and of course you need to use UrlDecode to solve the code first.
{data:$ (form) is not required when using $.post. Serialize ()} instead of direct $ (form). Serialize () on the line
Maybe because of this, a separate input value is turned into a string value of data.
{data:$ (form) is not required when using $.post. Serialize ()} instead of direct $ (form). Serialize () on the line
Maybe because of this, a separate input value is turned into a string value of data.
That's true, thanks.
No way? JQ so retarded?!
Submit the processing to the normal standard version.
If it's really what you say, then PARSE_STR is prepared for this, and of course you need to use UrlDecode to solve the code first.
Yes, I used the wrong one.