We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29106
    • 22 Posts
    Hey can some one help me convert this to a snippet or is it alright on its own to be one
    The code is
    <?PHP
    $page = file_get_contents("http://www.habbo.co.uk/home/$_GET[name]");
    eregi("<img alt='$_GET[name]' src='/habbo-imaging/avatar/(.*).gif' />", $page, $result);
    $name = $_GET[name];
    $url = "http://www.habbo.co.uk/habbo-imaging/avatar/$result[1].gif";
    echo("<img alt='$_GET[name]' src='$url' />");
    ?>

    Oh and would it be possible to store this in a database and retrieve it when i need it?
      • 32982
      • 674 Posts
      think is ok save like a normal snippet and call when you want ;-)
        Jabiertxof (formerly XYZVISUAL)
        My bussines: http://marker.es
        https://www.youtube.com/user/jabiertxof/videos
        • 11975
        • 2,542 Posts
        Hi,

        I would advise you to change the last line for

        return("<img alt=’$_GET[name]’ src=’$url’ />");

        That way you will control where the result appears in the document.

        ;-)
          Made with MODx : [url=http://www.copadel.com]copadel, fruits et l