I need to retrieve the information from this url :
http://example.com/ajax.php?sport=soccer&language_id=vn&block_id=page_home_1_block_home_matches_1&block_name=block_home_matches&callback_params={"date": "2016-01-14", "display": "all"}&action=updateContent¶ms={}
With my url like this:
http://example.net/ajax.php?sport=soccer&language_id=vn&block_id=page_home_1_block_home_matches_1&block_name=block_home_matches&callback_params=%7B%22date%22%3A%20%222016-01-14%22%2C%20%22display%22%3A%20%22all%22%7D&action=updateContent¶ms=%7B%7D
Here is ajax.php :
<?php
$sport = $_GET["sport"];
$language_id = $_GET["language_id"];
$block_id = $_GET["block_id"];
$block_name = $_GET["block_name"];
$callback_params = $_GET["callback_params"];
$action = $_GET["action"];
$params = $_GET["params"];
$url = "http://example.com/ajax.php?sport=$sport&language_id=$language_id&block_id=$block_id&block_name=$block_name&callback_params=$callback_params&action=$action&params=$params";
echo file_get_contents($url);
?>
But is return nothing, what wrong here ??
&in your url, you must add&instead. test it step by step, without get parameter, check it with one parameter and so on.