Jump to content

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();
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.