< b>Предупреждение: неопределенный ключ массива "Person" в C:\xampp\htdocs\linktree-vue\linktree-Create-Page.php в строке 7
null
Я пробовал следующее:
Код: Выделить всё
const Pagedata = {
Person: "Youmna",
};
const options = {
method: 'POST',
url: 'http://localhost/linktree-vue/linktree-Create-Page.php',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: Pagedata
};
axios.request(options)
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
Код: Выделить всё
header('Content-Type: application/json');
header("Access-Control-Allow-Origin: http://localhost:8080");
// Allow any domain to access the API
header("Access-Control-Allow-Origin: *");
$PersonName = $_POST['Person'];
print_r($PersonName);
echo json_encode($PersonName);
?>
Подробнее здесь: https://stackoverflow.com/questions/757 ... o-php-file
Мобильная версия