Location: PHPKode > projects > PHP Multiple Newsletters > class/functions.php
<?php
/***************************************************************************
File Name 	: functions.php
Domain		: http://www.triangle-solutions.com
----------------------------------------------------------------------------
Author		: Ian Warner
Copyright	: (C) 2001 Triangle Solutions Ltd
Email		: hide@address.com
URL		: http://www.triangle-solutions.com/
Description	: Holds the connection info and any functions.
Date Created	: Tuesday 24 February 2004 11:31:40
File Version	: 2.7
\\||************************************************************************/

############ DATABASE CONNECTION ############

	$version = 'v2.7';

	IF ($link = @mysql_connect($host, $user, $pass))
		{
		IF (!@mysql_select_db($data))
			{
			echo '	<P>This script has connected to the MySQL but could not connect to the Database
				Check your DATABASE settings in the config file';
			exit();
			}
		}
		ELSE
			{
			echo '	<P>This script could not connect to the MySQL
				Check your HOST, USER or PASS settings in the config file.';
			exit();
			}


############ FUNCTION PAGE TITLE BAR ############

	Function PageTitle($text)
		{
		Global $maintablewidth, $maintablealign, $background;
?>
		<TABLE Width=<?= $maintablewidth ?> Cellspacing=1 Cellpadding=1 Border=1 Bordercolor=#000000 Align=<?= $maintablealign ?>>
		  <TR BgColor=<?= $background ?>>
			<TD><P><?= $text ?></TD>
		  </TR>
		</TABLE>
<?php
		}


############ USECOLOR FUNCTION FOR COLOURED ROWS ############

	Function UseColor()
		{
		$trcolor1 = '#F0E68C';
		$trcolor2 = '#B0C4DE';
		static $colorvalue;

		IF($colorvalue == $trcolor1)
			$colorvalue = $trcolor2;
			ELSE
				$colorvalue = $trcolor1;

		return($colorvalue);
		}
?>
Return current item: PHP Multiple Newsletters