"SUCCESS", 'code'=>200, 'info'=>"上传成功", 'data'=>array( 'studentID'=>$studentID, 'reason'=>$reason, 'place'=>$place, 'info'=>$info, ) ); //请求参数(数组) $jsonStr = json_encode($arr); //转换为json格式 $result = http_post_json($url, $jsonStr); $result = json_decode($result,true); // 返回结果 if ($result['output'] == "SUCCESS") { echo << alert( "已提交出校申请,请通知班长或文体委员!" ) window.location.replace("/out_school.php"); EOF; } elseif ($result['output'] == "DATA_ERROR") { echo << alert( "数据出错,请重试" ) window.history.go(-1); EOF; } else { echo << alert( "未知错误" ) window.history.go(-1); EOF; } } else { echo << alert( "不要空账户" ) window.history.go(-1); EOF; }