【发布时间】:2017-08-11 05:27:22
【问题描述】:
## 这是我的 test.php 文件 ##
//here I am getting the variable value
<?PHP
$name = $_POST('variable');
echo $name;
?>
## 这是我的脚本 ##
//avariable value passing to test .php file
<script type ="text/javascript">
var name = "jani";
$.ajax({
type: 'POST',
url: 'test/test.php',
data: {'variable': name},
});
</script>
###** 我收到此错误 **###
Fatal error: Function name must be a string in
D:\xampp\htdocs\test\test.php on line 2
【问题讨论】:
-
在进行ajax调用时检查控制台,是否有任何值通过?
-
没有值传入控制台
标签: javascript php