Here is an example of how you could do this - use the gd function to make your image, but play and cache the images well. This example plays even better if the browser already has the required image, it returns 304 ...
#here where we'll store the cached images $cachedir=$_SERVER['DOCUMENT_ROOT'].'/imgcache/' #get the score and sanitize it $score=$_GET['score']; if (preg_match('/^[0-9]\.[0-9]{1,2}$/', $score) { #figure out filename of cached file $file=$cachedir.'score'.$score.'gif'; #regenerate cached image if (!file_exists($file)) { #generate image - this is lifted straight from the php #manual, you'll need to work out how to make your
If you put this in image.php, you should use in the image tag
following:
<img src="image.php?score=5.5" alt="5.5" />
source share