$ _GET替换。用_

时间:2017-01-11 22:51:47

标签: php

这是我的代码,当从我的程序运行时,它一直在替换。用_

<?php

if(!isset($_GET["fig"]) || empty($_GET["fig"])) {
    echo "No fig request";
    exit;
}

$ch = curl_init("https://www.habbo.com.br/habbo-imaging/avatarimage?hb=img&figure={$_GET["fig"]}&action=wav&direction=2&head_direction=3&size=m");

curl_setopt_array($ch, array(
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HEADER         => false,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING       => "",
    CURLOPT_USERAGENT      => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
    CURLOPT_AUTOREFERER    => true,
    CURLOPT_SSL_VERIFYPEER => false
));

$content = curl_exec($ch);
$type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);

curl_close($ch);

if(!isset($content) || empty($content) || strpos($content, 'Not Found') !== false) {
    echo "Not found!";
    exit;
}

header("Content-Type: {$type}");

echo $content;
?>

我试过这个

$figure = str_replace('_', '.', $_GET["fig"]);
$ch = curl_init("https://www.habbo.com.br/habbo-imaging/avatarimage?hb=img&figure={$figure}&action=wav&direction=2&head_direction=3&size=m");

但它似乎并不想解决我所拥有的问题,我似乎无法弄清楚为什么如此,如果有人能够帮助我解决这个问题将非常感激

0 个答案:

没有答案