|
|
Spread the Word
If you or your organization has a website, help us spread the word
by linking to Helping Kids Cope. Click here
for easy linking instructions.
include("inc/header.php");
include("inc/config.inc.php");
// check the language pack
if($l=="t")
{
include("inc/turk.lang.inc.php");
}
elseif($l=="e")
{
include("inc/eng.lang.inc.php");
}
// check the form submission
if(isset($submit))
{
function msg($messagetype,$m)
{
global $l,$goback;
?>
exit;
}
/*==========================================*/
/* YOU DO NOT NEED TO MODIFY ANYTHING BELOW */
/*==========================================*/
// Checks the form submission
/*---------------------------------------------------------------------------------------*/
/* function checks the empty fields */
function check_fields($field,$fieldname,$errormessage)
{
if (empty ($field))
{
msg("$errormessage","$fieldname");
}
}
check_fields ("$sname","$yourname","$emptyfield");
check_fields ("$rname","$recipientname","$emptyfield");
/* Function checks the validity of the email addresses */
function check_email($email,$mailtype,$errmessage)
{
global $emptymail1,$emptymail2;
if (!empty($email))
{
$mail_test= trim($email);
// this line does not belong to me. Thanks to person who wrote this !!
if (!eregi("^[_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,3}$", $mail_test))
{
msg( "$errmessage","$mail_test");
}
}
else
{
msg( "$emptymail1","$mailtype");
}
}
check_email("$smail","$yourmail","$invalidmail");
check_email("$rmail","$recipientmail","$invalidmail");
/* building the mail body */
$mailbody="$suggestionfor ".$rname."\n\n";
$mailbody.=$siteownermessage."\n";
$mailbody.=$url."\n\n";
$mailbody.="$from ".$sname."\n";
$mailbody.="$sendersmail ".$smail."\n\n";
if (!empty($message))
{
$mailbody.=$sname." $wrote\n";
$mailbody.="-----------------------------------\n";
$mailbody.=$message;
}
$mailbody.="\n-----------------------------------\n";
$mailbody.=$author;
$mailheaders="From: $sitename<$adminmail>\n";
$mailheaders.="Bcc: joseph@josephschell.com\n";
/* building the body of the mail for the sender */
if ($mailtosender=="1")
{
$smailbody=$sname.",\n";
$smailbody.=$thankyoumessage."\n";
$smailbody.="\n-----------------------------------\n";
$smailbody.=$author;
$smailheaders="From: $sitename<$adminmail>\n";
mail($smail,$thankyousubject,$smailbody,$smailheaders);
}
/* sends the mail */
if (@mail($rmail,$mailsubject,$mailbody,$mailheaders))
{
msg( "$mailsent","$rmail");
}
else
{
msg ("$error","$mailproblem");
}
// displays the form if no submission
}
else
{
?>
}
include("inc/footer.php");
?>
|