GD question
Posted: Mon Oct 20, 2003 10:44 pm
I've followed some links given here and gotten GD stuff to work - at least I thought...
this page - http://public.radicant.net/motr_keystrokes.php - works when viewed by itself, but it doesn't when i try to include it as an image in html...here's the code
PHP -
HTML -
Any ideas?
this page - http://public.radicant.net/motr_keystrokes.php - works when viewed by itself, but it doesn't when i try to include it as an image in html...here's the code
PHP -
Code: Select all
<?php
// open stats file
$file = fopen("http://pulse.whatnet.org/api/user.php?account=motr", "r");
// skip to number file
fgets($file);
fgets($file);
fgets($file);
fgets($file);
fgets($file);
fgets($file);
fgets($file);
fgets($file);
$Keystrokes = explode(" ", fgets($file));
// close stats file
fclose($file);
// create image
header ("Content-type: image/png");
$img_handle = ImageCreate (220, 18) or die ("Cannot Create image");
$back_color = ImageColorAllocate ($img_handle, 67, 64, 58);
ImageTTFText ($img_handle, 8, 0, 5, 12, ImageColorAllocate ($img_handle, 143, 137, 127), "/WINDOWS/Fonts/Verdana.ttf", $Keystrokes[2] . " keystrokes and counting...");
ImagePng ($img_handle);
?>Code: Select all
<img src="http://public.radicant.net/motr_keystrokes.php" alt="" />