I wrote a quick program for displaying random quotes in my forum signatures ;)
I share the code with you below

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
	// 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)

http://www.ninethsense.com/quote/quote.php

VN:F [1.1.6_502]
Rating: 0.0/5 (0 votes cast)
Share:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • LinkedIn
  • Live
  • MySpace
  • StumbleUpon
  • Technorati

Related posts:

  1. SQL Server 2008 Developer Training Kit
  2. IT Success Quotes
  3. Single Page Editor #2 in PHP - Version 1.1