Class outputs image, I need to save the image instead

I’m using this class to grab favicons: http://www.controlstyle.com/articles…t/php-favicon/

here’s my code:

PHP Code:


if (file_exists($filename)) {
    echo 
'yes';
}
else {
    include(
'favicon.php');
    
    
$favicon = new favicon($url0);
    
$fv $favicon->get_output_data();

    if ($fv!=='')
    {
        
header('Content-type: image/png');
        echo 
$fv;
    }





Right now it says yes if I already have the icon saved (in a favicon folder, as ‘domaincom.png’), and if I don’t have it, it outputs it. How can I change it from outputting the file, to instead just saving it into the favicon folder (under $filename) and giving me a confirmation that it worked.

Also, sometimes the class outputs just a white square, not sure if anyone has a solution for that.

View full post on Tycoon Talk

, , , , ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Get Adobe Flash playerPlugin by wpburn.com wordpress themes


RSS Site FeedRSS Site Feed

© 1992-2011 DC2NET™, Inc. All Rights Reserved