[ PHPXref.com ] [ Generated: Sun Jul 20 19:47:34 2008 ] [ phpMyFAQ 1.6.1 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> mailsend2friend.php (source)

   1  <?php
   2  /**
   3  * $Id: mailsend2friend.php,v 1.4.2.6.2.4 2006/04/25 12:07:24 matteo Exp $
   4  *
   5  * Sends the emails to your friends
   6  *
   7  * @author       Thorsten Rinne <thorsten@phpmyfaq.de>
   8  * @since        2002-09-16
   9  * @copyright    (c) 2001-2006 phpMyFAQ Team
  10  *
  11  * The contents of this file are subject to the Mozilla Public License
  12  * Version 1.1 (the "License"); you may not use this file except in
  13  * compliance with the License. You may obtain a copy of the License at
  14  * http://www.mozilla.org/MPL/
  15  *
  16  * Software distributed under the License is distributed on an "AS IS"
  17  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
  18  * License for the specific language governing rights and limitations
  19  * under the License.
  20  */
  21  
  22  if (!defined('IS_VALID_PHPMYFAQ')) {
  23      header('Location: http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME']));
  24      exit();
  25  }
  26  
  27  Tracking("sendmail_send2friend",0);
  28  
  29  $captcha = new PMF_Captcha($db, $sids, $pmf->language, $_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR']);
  30  
  31  if (   isset($_POST['name']) && $_POST['name'] != ''
  32      && isset($_POST['mailfrom']) && $_POST['mailfrom'] != ''
  33      && isset($_POST['mailto']) && $_POST['mailto'] != ''
  34      && IPCheck($_SERVER['REMOTE_ADDR'])
  35      && checkBannedWord(htmlspecialchars(strip_tags($_POST['zusatz'])))
  36      && checkCaptchaCode() ) {
  37  
  38      $name = $db->escape_string(strip_tags($_POST["name"]));
  39      $mailfrom = $db->escape_string(strip_tags($_POST["mailfrom"]));
  40      $link = $db->escape_string(strip_tags($_POST["link"]));
  41      $attached = $db->escape_string(strip_tags($_POST["zusatz"]));
  42      $mailto = $_POST['mailto'];
  43  
  44      list($user, $host) = explode("@", $mailto[0]);
  45      if (checkEmail($mailfrom)) {
  46          foreach($mailto as $mail) {
  47              $mail = $db->escape_string(strip_tags($mail));
  48              if ($mail != "") {
  49                  mail($IDN->encode($mail), $PMF_LANG["msgS2FMailSubject"].$name, $PMF_CONF["send2friend_text"]."\n\n".$PMF_LANG["msgS2FText2"]."\n".$link."\n\n".$attached, "From: ".$IDN->encode($mailfrom));
  50                  usleep(500);
  51              }
  52          }
  53          $tpl->processTemplate ("writeContent", array(
  54                  "msgSend2Friend" => $PMF_LANG["msgSend2Friend"],
  55                  "Message" => $PMF_LANG["msgS2FThx"]
  56                      ));
  57      } else {
  58          $tpl->processTemplate ("writeContent", array(
  59                  "msgSend2Friend" => $PMF_LANG["msgSend2Friend"],
  60                  "Message" => $PMF_LANG["err_noMailAdress"]
  61                  ));
  62      }
  63  } else {
  64      if (IPCheck($_SERVER["REMOTE_ADDR"]) == FALSE) {
  65          $tpl->processTemplate ("writeContent", array(
  66                  "msgSend2Friend" => $PMF_LANG["msgSend2Friend"],
  67                  "Message" => $PMF_LANG["err_bannedIP"]
  68                  ));
  69      } else {
  70          $tpl->processTemplate ("writeContent", array(
  71                  "msgSend2Friend" => $PMF_LANG["msgSend2Friend"],
  72                  "Message" => $PMF_LANG["err_sendMail"]
  73                  ));
  74      }
  75  }
  76  
  77  $tpl->includeTemplate("writeContent", "index");


[ Powered by PHPXref - Served by Debian GNU/Linux ]