Jump to content

Image script not working in Opera


lordfrikk

Recommended Posts

Hey,

 

this is what it should like (viewed in Internet Explorer and Firefox 3 Beta 3):

 

figure-one-ie.gif

 

And this is how it looks like (viewed in Opera 9.50 Beta):

 

figure-two-opera.gif

 

This is my signature here on forums:

 

[img=TOP IMAGE HERE]
[img=http://lordik.php5.cz/sigcnt/counter_en.gif]

 

The script is camouflaged so the forums accept it between image tag in this way (counter_en.gif is directory in fact):

 

http://lordik.php5.cz/sigcnt/counter_en.gif/INDEX.PHP <-- this is the script

 

The snippet itself:

 

<?php
$filename = '../counter.dat';

if (file_exists($filename)):
$count = file_get_contents($filename);
file_put_contents($filename, $count + 1);
else:
$f = fopen($filename, 'x');
$count = 1;
fputs($f, $count);
fclose($f);
endif;

$message = sprintf('This signature has been viewed %d times ', $count);

$font = 1;

$width = imagefontwidth($font) * strlen($message);
$height = imagefontheight($font);

$im = imagecreatetruecolor($width, $height);

$black = imagecolorallocate($im, 0, 0, 0);
$white = imagecolorallocate($im, 255, 255, 255);

imagefill($im, 0, 0, $white);

imagestring($im, 1, 0, 0, $message, $black);

imagecolortransparent($im, $white);

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Content-type: image/gif');
imagegif($im);

imagedestroy($im);
?>

Link to comment
https://forums.phpfreaks.com/topic/96131-image-script-not-working-in-opera/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.