functions.php




EOF;
}

function printFooter(){
echo <<


This implementation of Zinn’s PAEI is Copyright 2008-2012, LabR Learning Resources.

EOF;
}

function Connecti()
{
/* ———————————————————————–
Make the connection to the database
———————————————————————– */
$databaseHost = “labrnet.ipowermysql.com”;
$databaseUser = “paei”;
$databasePassword = “thisisgood”;
$databaseName = “paei”;
$connection = new mysqli($databaseHost, $databaseUser, $databasePassword, $databaseName);

#$connection = mysqli_connect($databaseHost, $databaseUser, $databasePassword);
if ( ! $connection )
{
$error_message = mysql_error();
}
return($connection);
}

function Connect($verbose)
{
/* ———————————————————————–
Make the connection to the database
———————————————————————– */
$databaseHost = “labrnet.ipowermysql.com”;
$databaseUser = “paei”;
$databasePassword = “thisisgood”;
$databaseName = “paei”;
#
# 90200 – connected
# 90400 – no connection to server
# 90401 – no connection to database
# 90403 – access denied for user

if ( $verbose == 1 )
{
?>

Connecting to server:


Could not establish connection to the server




Established


Connecting to database:


Could not establish connection to the database




Established
0)
{
?>

0)
{
?>



“);
$HTMLMessage =nl2br($comment);
$FromName =strip_tags($name);
$FromEmail =strip_tags($email);
$Subject =strip_tags($subject);

$boundary1 =rand(0,9).”-”
.rand(10000000000,9999999999).”-”
.rand(10000000000,9999999999).”=:”
.rand(10000,99999);
$boundary2 =rand(0,9).”-“.rand(10000000000,9999999999).”-”
.rand(10000000000,9999999999).”=:”
.rand(10000,99999);

#for($i=0; $i < count($_FILES['youfile']['name']); $i++){ #if(is_uploaded_file($_FILES['fileatt']['tmp_name'][$i]) && #!empty($_FILES['fileatt']['size'][$i]) && #!empty($_FILES['fileatt']['name'][$i])){ $attach ='yes'; $end =''; $handle =fopen($file, 'rb'); $f_contents =fread($handle, filesize($file)); $attachment=chunk_split(base64_encode($f_contents)); fclose($handle); $ftype[] =$_FILES['fileatt']['type'][$i]; $fname[] =$_FILES['fileatt']['name'][$i]; #} #} /*************************************************************** Creating Email: Headers, BODY 1- HTML Email WIthout Attachment!! <<-------- H T M L --------- ***************************************************************/ #---->Headers Part
$Headers =<<
Reply-To: $FromEmail
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary=”$boundary1″
AKAM;

#—->BODY Part
$Body =<<
Reply-To: $FromEmail
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary=”$boundary1″
AKAM;

$attachments.=<<sent“:”not sent“;

}
?>