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($url, 0);
$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
Class, image, instead, need, outputs, Save