gpt4 book ai didi

php - 将值从 angular.service 传递到 php 文件

转载 作者:搜寻专家 更新时间:2023-10-31 21:51:52 28 4
gpt4 key购买 nike

我正在尝试将参数从我的 angular.service 传递到 PHP 文件

function SearchStudent(studentId) {
return $http.get('app-data/search-student.php',
{params: { studentId: studentId }})
.then(function(response) {
return response.data;
});
}

然后我尝试在我的 php 文件中使用 _GET 检索该值

$studentId = $_GET['studentId'] . "%";

问题不只是获取 ID,而是获取 {"studentId":"######"}

最佳答案

您的 SearchStudent 函数已经在 studentId 参数中接收 {"studentId":"######"},因此您正在将 { studentId: {studentId: '######' }} 发送到您的 PHP 文件。

关于php - 将值从 angular.service 传递到 php 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40310378/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com