Answer the question
In order to leave comments, you need to log in
Pass vue.js form data in json key/value format to php handler?
I'm doing something wrong https://codepen.io/serg-style/pen/bZZyeb
In the handler, for now, I'm just displaying
<?php
print($jsonData);
?>
Answer the question
In order to leave comments, you need to log in
<?php
$postData = file_get_contents('php://input');
$data = json_decode($postData);
print $data->name;
If you send in `multipart/form-data` format
const formData = new FormData(this.$refs.form);
axios({
method: 'post',
url: 'http://appvue.pickstyle.ru/static/lib/phpfile.php',
data: formData,
config: { headers: {'Content-Type': 'multipart/form-data' }}
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question