AJAX。 PHP。 卷曲。 Ajax请求到站点,使用另一种编码

I try to parse one page from my another site. For it i use cUrl

Request (send data to script):

        $.ajax({
            url: 'wordstat/ajax?query='+query+'&page='+page+'&id='+id,
            success: function(data){
                alert(data);
            }
        });

This script (wordstat/ajax), do request to my second site via controller:

Controller:

public function ajax()
{
    $this->model->auth();
    echo $this->model->parse_uri($_GET['page'],$_GET['query']);

}

Model:

public function parse_uri($url,$word)
{
    curl_setopt($this->curl, CURLOPT_URL, "http://wordstat/rating.php?url=".$url."&word=".$word."&gap=3");

    $html = mb_convert_encoding(str_replace("
","",curl_exec($this->curl)), "utf-8", "windows-1251");
    preg_match('/<span style="font-size:14px" class=red>(.*)<\/span>/U',$html,$matches);
    return $matches;
}

If i put in browser http://localhost/wordstat/ajax?page=page&url=url and open this page, then she return value of <span style="font-size:14px" class=red> of another site correctly

But when i do it via Ajax request, it's always return empty Array

What i doin wrong? Sorry for bad english

Problem resolved

    $url = str_replace(" ","",$url);
    $word = str_replace(" ","",$word);

    curl_setopt($this->curl, CURLOPT_URL, "http://parser/rating.php?url=".$url."&word=".$word."&gap=3");

    $html = str_replace("
","",curl_exec($this->curl));
    preg_match('/<span style="font-size:14px" class=red>(.*)<\/span>/U',$html,$matches);

    return $matches;

Thanks to anyoune, who tried help

You use directly in browser

wordstat/ajax?page=page&url=url

but ajax use

wordstat/ajax?query='+query+'&page='+page+'&id='+id

Perhaps different arguments give you different results.