is_name_valid()) { $error_string[] = $error_name; } if ($MAIANFRIEND->is_email_valid()) { $error_string[] = $error_email; } if ($MAIANFRIEND->is_recipients_valid()) { $error_string[] = $no_emails; } if (!$MAIANFRIEND->is_recipients_valid()) { if ($MAIANFRIEND->check_recipients()) { $error_string[] = $error_friend_email; } } if (ENABLE_CAPTCHA) { include('inc/captcha/php-captcha.inc.php'); if (strlen($code)!=CAP_CHARS || !PhpCaptcha::Validate($code)) { $error_string[] = $index_code_error; } } //-------------------------------------- // See if error string array is empty // If it is not, show errors //-------------------------------------- if (!empty($error_string)) { $tpl_error =& new Savant2(); $MAIANFRIEND->show_error($tpl_error,$charset,$error,$error_string,$return); exit; } //------------------------------------------- // If there are no errors, send messages //------------------------------------------- $unique = array(); $unique = $MAIANFRIEND->get_unique_emails(); //-------------------------------------------------- // Send messages // If no comments have been entered, send default //-------------------------------------------------- foreach ($unique as $send) { if ($MAIANFRIEND->is_comments_valid()) { $MAIANFRIEND->send_default_message($send,WEBSITE_NAME,EMAIL_ADDRESS,str_replace('{name}', $name, $recipient_subject)); } else { $MAIANFRIEND->send_recipient_message($send,WEBSITE_NAME,EMAIL_ADDRESS,str_replace('{name}',$name, $recipient_subject)); } } //----------------------------------------- // If enabled, send message to webmaster //----------------------------------------- if (EMAIL_WEBMASTER) { $MAIANFRIEND->send_webmaster_mail(EMAIL_ADDRESS,$webmaster_subject,WEBSITE_NAME); } //----------------------------------------- // If enabled, send message to visitor //----------------------------------------- if (EMAIL_VISITOR) { $MAIANFRIEND->send_visitor_mail(WEBSITE_NAME,$visitor_subject,EMAIL_ADDRESS); } //------------------------------------------- // Display thanks page and we are all done //------------------------------------------- $tpl_thanks =& new Savant2(); $MAIANFRIEND->show_thank_you($tpl_thanks,$charset,$thankyou,$send_details,$unique,$support,$continue); exit; } include('inc/header.php'); //----------------------------------- // Are we showing referrring page? //----------------------------------- $referer = ''; if (REFERER) { $referer = $_SERVER['HTTP_REFERER']; } //------------------------------- // Is the captcha enabled? //------------------------------- $captcha_code = ''; if (ENABLE_CAPTCHA) { $captcha_code = ' '.$index_code_text.': '.$index_code_text.'

* '; } //----------------------------------------------------- // Create instance of Savant template class (Main) //----------------------------------------------------- $tpl_index =& new Savant2(); $tpl_index->addPath('template', '/home/aman/site/excerpt/friend/'); $tpl_index->assign('REQUIREDFIELDS', $index_required); $tpl_index->assign('NAME', $index_name); $tpl_index->assign('EMAIL', $index_email); $tpl_index->assign('RECIPIENTS', $index_recipients); $tpl_index->assign('MUSTINCLUDE', $index_include); $tpl_index->assign('COMMENTS', $index_comments); $tpl_index->assign('LEAVEBLANK', $index_default); $tpl_index->assign('REFERER', $referer); $tpl_index->assign('CAPTCHA', $captcha_code); $tpl_index->assign('SEND', $index_submit); $tpl_index->assign('CLEAR', $index_clear); $tpl_index->display('templates/index.tpl.php'); if ($tpl_index->isError($result)) { echo "There was an error displaying the template.
";
    print_r($result);
    echo "
"; } include('inc/footer.php'); ?>