Quote Of The Day.

The holy passion of Friendship is of so sweet and steady and loyal
and enduring a nature that it will last through a whole lifetime,
if not asked to lend money.     Mark Twain, "Pudd'nhead Wilson's Calendar"

This OpenVMS system has been up for fourteen days, four hours and twenty-eight minutes.


Home page

/~miker/qotd.php script written by
Mike Rechtman © 2004
Apache/1.3.26 Server at polarhome.com Port 80


To show a QOTD on your (PHP-enabled) page include the following code:

<?php

error_reporting(0) ;

// Note: From a web page outside the polarhome domain,
//       replace "alpha.polarhome.com" with "www.polarhome.com"
//       Or try port 17 on "alpha.mike-r.com"
//       (You can test by trying: telnet alpha.mike-r.com 17 )

$fp = fsockopen( "alpha.polarhome.com",3017,$errno,$errstr,5 ) ;

error_reporting(15) ;

if ( !$fp ) : 
	{
	echo "Error ($errno): $errstr opening QOTD server <BR>\n" ;
	echo "     alpha.polarhome.com on port 3017 \n <P>" ;
	}
else :
	{
	socket_set_timeout($fp,10) ;
	socket_set_blocking( $fp,1 );
	$buff = fread( $fp, 4096 ) ;
	fclose( $fp );

	// remove non-printable character that might have snuck in:
	$low_values = array( 1,2,3,4,5,6,7,8,11,12,14,15,16,17,
		18,19,20,21,22,23,24,25,26,27,28,29,30,31 ) ;
	$low_chars = array( ) ;
	$i = 1 ;
	// skip TAB, LF, CR
	foreach( $low_values as $i => $x )
		{
		$low_chars[$i] = chr( $x ) ;
		}

	$high_chars = array( ) ;
	for ( $i=1 ; $i < 95 ; $i++ )
		{
		$high_chars[$i] = chr( $i + 160 ) ;
		}
	$buff = str_replace( $high_chars,'',$buff ) ;
	$buff = str_replace( $low_chars,'',$buff ) ;

	$mess = trim( $buff ) ;

	echo '<B>' . nl2br( $mess ) . '</B>' ;

	}
endif ;
 ?>