D
D
Dmitry Zhukov2018-04-11 10:41:47
PHP
Dmitry Zhukov, 2018-04-11 10:41:47

How to parse a POST request correctly?

I send data with ajax: formData is the result of collecting form data using serialize() send_mail - passing the name of the called function (this is me trying to set up ajax sending mail to wordpress from the front) In the php function I get the result of the post array. As I understand it, formData is just a string of the form admin_email=admin.fdr%40gmail.com&main_register=true How to properly decompose this string into a "key-value" for further sending to the mail?
data: {'formData': formData, 'action':'send_mail'}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sanovskiy, 2018-04-11
@dreamfdr

parse_str()
If it is standard serialize()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question