Jump to content

[SOLVED] Forcing .php through img tag.


thecard

Recommended Posts

<img src="counter.php" height="50" width="450" border='0' />

 

The .php file echos an image with a variable echoed on top of the image.

But all that appears on the page is the firefox sign meaning broken link or something...

But when I right click the empty image and click "view image" I see the image in a new window how it should be so it isn't a broken link.

I know this can be done.

Where am I going wrong  ????

Thanks for any help.

thecard

Link to comment
https://forums.phpfreaks.com/topic/135848-solved-forcing-php-through-img-tag/
Share on other sites

Heres a basic example that may help

<img src="counter.php?c=10" height="50" width="450" border='0' />

 

<?php
header("Content-type: image/png");
$Count = (int)$_GET['c'];
$im = imagecreatefrompng("images/hitcounter2.png");
$tc  = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 1, 5, 5, $Count, $tc);
imagepng($im);
imagedestroy($im);
exit();
?>

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.