【php – json请求在localhost中工作但不在服务器中工作】教程文章相关的互联网学习教程文章

php – json请求在localhost中工作但不在服务器中工作【代码】

XAMPP 1.7.4如果我运行带有json编码的php文件,它在localhost中运行正常但是如果我将其迁移到服务器,在服务器中接收的请求是NULL,我不知道什么是错的,即使对于简单的程序它也不是工作的 这是我的代码<?php header('Content-type:application/json; charset:utf-8'); if(isset($_GET['request'])) {$str = $_GET['request']; $arr=json_decode($str, true);$username2 = $arr['username']; echo json_encode($username2); } ?>这是我...