<?php
// 服务器来接收前端的参数 通过post 方法来接收
$data = $_POST["data"];
// 设置服务器的请求头 html5 cors 跨域
// php 拼字符串 使用 .的方式
header('Access-Control-Allow-Origin:http://web.juhe.cn:8080/constellation/getAll?consName='.$data.'&type=today&key=890064907a021b485e9caf5a49865fb9');
// 设置请求方式
header("Access-Control-Allow-Method:GET");
// 从三方服务器拿数据
$url = 'http://web.juhe.cn:8080/constellation/getAll?consName='.$data.'&type=today&key=890064907a021b485e9caf5a49865fb9';
//读取地址文件
$html=file_get_contents($url); //返回的是字符串
// 返回给浏览器
echo $html;
?>