Wed
16
Jan '08
I wrote a quick program for displaying random quotes in my forum signatures
I share the code with you below
Here is the demo: (try refresh)
I share the code with you below
// Random Quotes with PHP
// Praveen - ninethsense
// 16 January 2008
header(“Content-type: image/png”);
$file = file(“quotes.txt”);
$txt = $file[rand(1, count($file)-1)];
$txt = substr($txt,0,strlen($txt)-2);
$im = imagecreate((strlen($txt)*8),15);
$bgcolor = imagecolorallocate($im, 230, 230, 230);
imagecolortransparent($im,$bgcolor);
$col = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 2, 0, 0, $txt, $col);
imagepng($im);
imagedestroy($im);
Here is the demo: (try refresh)

Leave a passing comment »