TimRogers Posted March 4, 2006 Share Posted March 4, 2006 <?php header("Content-type: image/png"); $datafile = "last-seen.dat"; $loadfile = fopen($datafile, 'r'); $data = fread($loadfile, filesize($datafile)); fclose($loadfile); $im = imagecreatefrompng("template.png"); $textcolour = imagecolorallocate($im, 0, 0, 0); imagestring($im, 1, 140, 7, $data, $textcolour); $writing = fopen($datafile, 'w'); $towrite .= date('d'); $towrite .= " "; $towrite .= date('F'); $towrite .= " "; $towrite .= date('Y'); $towrite .= " at "; $towrite .= date('H'); $towrite .= ":"; $towrite .= date('i'); $towrite .= ":"; $towrite .= date('s'); fwrite($writing, $towrite); fclose($writing); ?> In Firefox if you visit it you get the URL of the page printed out, and for some reason it's not highlightable, and in IE you just get an image error box. Why? http://www.tim-rogers.co.uk/lastseen/bar.php Link to comment Share on other sites More sharing options...
0 jtchange Posted March 4, 2006 Share Posted March 4, 2006 i think you need to use the imagepng() function to output the image...you have the image created, but you aren't outputting it. imagepng($im); more info: http://us3.php.net/imagepng Link to comment Share on other sites More sharing options...
0 TimRogers Posted March 4, 2006 Author Share Posted March 4, 2006 Thank you :) That did it! Link to comment Share on other sites More sharing options...
Question
TimRogers
In Firefox if you visit it you get the URL of the page printed out, and for some reason it's not highlightable, and in IE you just get an image error box. Why?
http://www.tim-rogers.co.uk/lastseen/bar.php
Link to comment
Share on other sites
2 answers to this question
Recommended Posts