phpfunctioneregi

function egeri() doesn't work


I have this code but, when I logged in habbo the function doesn't work for the image online, it just shows the image offline:

<?php
$name = $_GET['habbo'];
$home = file_get_contents("http://www.habbo.com.br/home/".$name);
if (eregi("http://habboo-a.akamaihd.net/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/2245/web-gallery/images/myhabbo/profile/habbo_online_anim.gif", $home))
{
$img = "http://habboo-a.akamaihd.net/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/2245/web-gallery/images/myhabbo/profile/habbo_online.gif";
}
else
{
$img = "http://habboo-a.akamaihd.net/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/2245/web-gallery/images/myhabbo/profile/habbo_offline.gif";
}
header("Content-type: image/gif");
$im = imagecreatefromgif($img);
imagegif($im);
imagedestroy($im);
?>

Solution

  • Try this:

    <?php
    $name = $_GET['habbo'];
    $home = file_get_contents('http://www.habbo.com.br/home/'.$habbo);
    if (stristr($home, 'http://habboo-a.akamaihd.net/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/2245/web-gallery/images/myhabbo/profile/habbo_online_anim.gif') == TRUE)
    {
        $img = 'http://habboo-a.akamaihd.net/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/2245/web-gallery/images/myhabbo/profile/habbo_online.gif';
    }
        else
    {
        $img = 'http://habboo-a.akamaihd.net/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/2245/web-gallery/images/myhabbo/profile/habbo_offline.gif';
    }
    header('Content-type: image/gif');
    $im = imagecreatefromgif($img);
    imagegif($im);
    imagedestroy($im);
    

    stristr acts like eregi when you're not using regexp, this should find the string and compare if it's TRUE or FALSE.

    Update: '=== TRUE' to '== TRUE'