Exemplo n.º 1
0
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
Tracking("sendmail_send2friend", 0);
$captcha = new PMF_Captcha($db, $sids, $pmf->language, $_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR']);
if (isset($_POST['name']) && $_POST['name'] != '' && isset($_POST['mailfrom']) && $_POST['mailfrom'] != '' && isset($_POST['mailto']) && $_POST['mailto'] != '' && IPCheck($_SERVER['REMOTE_ADDR']) && checkBannedWord(htmlspecialchars(strip_tags($_POST['zusatz']))) && checkCaptchaCode()) {
    $name = $db->escape_string(strip_tags($_POST["name"]));
    $mailfrom = $db->escape_string(strip_tags($_POST["mailfrom"]));
    $link = $db->escape_string(strip_tags($_POST["link"]));
    $attached = $db->escape_string(strip_tags($_POST["zusatz"]));
    $mailto = $_POST['mailto'];
    list($user, $host) = explode("@", $mailto[0]);
    if (checkEmail($mailfrom)) {
        foreach ($mailto as $mail) {
            $mail = $db->escape_string(strip_tags($mail));
            if ($mail != "") {
                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));
                usleep(500);
            }
        }
        $tpl->processTemplate("writeContent", array("msgSend2Friend" => $PMF_LANG["msgSend2Friend"], "Message" => $PMF_LANG["msgS2FThx"]));
Exemplo n.º 2
0
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $sids, $pmf->language, $_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR']);
if (isset($_POST['username']) && $_POST['username'] != '' && isset($_POST['usermail']) && checkEmail($_POST['usermail']) && isset($_POST['content']) && $_POST['content'] != '' && IPCheck($_SERVER['REMOTE_ADDR']) && checkBannedWord(htmlspecialchars(strip_tags($_POST['content']))) && checkCaptchaCode()) {
    if (isset($_POST['try_search'])) {
        $suchbegriff = strip_tags($_POST['content']);
        $printResult = searchEngine($suchbegriff, $numr);
        echo $numr;
    } else {
        $numr = 0;
    }
    if ($numr == 0) {
        $cat = new category();
        $categories = $cat->getAllCategories();
        $usermail = $db->escape_string($IDN->encode($_POST['usermail']));
        $username = $db->escape_string(strip_tags($_POST['username']));
        $selected_category = intval($_POST['rubrik']);
        list($user, $host) = explode("@", $usermail);
        if (checkEmail($usermail)) {
Exemplo n.º 3
0
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
Tracking("sendmail_contact", 0);
$captcha = new PMF_Captcha($db, $sids, $pmf->language, $_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR']);
if (isset($_POST["name"]) && $_POST["name"] != '' && isset($_POST["email"]) && checkEmail($_POST["email"]) && isset($_POST["question"]) && $_POST["question"] != '' && IPCheck($_SERVER['REMOTE_ADDR']) && checkBannedWord(htmlspecialchars(strip_tags($_POST['question']))) && checkCaptchaCode()) {
    list($user, $host) = explode("@", $_POST["email"]);
    $question = htmlspecialchars($_POST["question"]);
    $sender = $IDN->encode($_POST["email"]);
    $subject = 'Feedback: ' . $PMF_CONF['title'];
    $name = htmlspecialchars($_POST['name']);
    if (function_exists('mb_encode_mimeheader')) {
        $name = mb_encode_mimeheader($name);
    } else {
        $name = encode_iso88591($name);
    }
    $additional_header = array();
    $additional_header[] = 'MIME-Version: 1.0';
    $additional_header[] = 'Content-Type: text/plain; charset=' . $PMF_LANG['metaCharset'];
    if (strtolower($PMF_LANG['metaCharset']) == 'utf-8') {
        $additional_header[] = 'Content-Transfer-Encoding: 8bit';
Exemplo n.º 4
0
    public function contact()
    {
        $result = array();
        $valid = true;
        if ($this->request->is(array('post', 'put'))) {
            $this->loadModel('Contact');
            $post = $this->Contact->find('first', array('order' => array('Contact.id DESC'), 'limit' => '1'));
            if (count($post) == 0) {
                $id = 1;
            } else {
                $id = $post['Contact']['id'] + 1;
            }
            $this->request->data['Contact']['id'] = $id;
            $this->request->data['Contact']['cu_read'] = 0;
            $this->request->data['Contact']['cu_active'] = 1;
            $this->request->data['Contact']['cu_date_created'] = date('Y-m-d H:i:s');
            $this->request->data['Contact']['cu_date_modified'] = date('Y-m-d H:i:s');
            $emailc = trim($this->request->data['Contact']['cu_email']);
            if (empty($emailc) || !preg_match('|^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$|i', $emailc)) {
                $result['ero'] = 'Invalid email address.';
                $valid = false;
            }
            // LAST CHECK FOR CAPTCHA
            if (!checkCaptchaCode($_POST['captcha_code'])) {
                $result['ero_captcha'] = 'Wrong captcha code.';
                $valid = false;
            }
            if ($valid) {
                $this->Contact->create();
                $this->Contact->save($this->request->data);
                $this->Session->setFlash('
					<div class="alert alert-success alert-dismissible" role="alert">
						<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						<strong>Success</strong> Message has been sent successfully
					</div>
				');
                // prepare the email...
                App::uses('CakeEmail', 'Network/Email');
                $Email = new CakeEmail();
                $mybody = "<strong>Message from<br/><br/>";
                $mybody .= "Name : " . $this->request->data['Contact']['cu_name'] . "<br/>";
                $mybody .= "Subject : " . $this->request->data['Contact']['cu_subject'] . "<br/>";
                $mybody .= "<br/>Content :<br/>" . str_replace(chr(13) . chr(10), '<br/>', $this->request->data['Contact']['cu_message']) . "<br/>";
                $email = array_filter(explode("\r\n", $this->email_admin));
                try {
                    if ($Email->from(array($this->request->data['Contact']['cu_email'] => $this->request->data['Contact']['cu_name']))->to($email)->subject($this->request->data['Contact']['cu_subject'] . " - Contact Message")->emailFormat('html')->template('default', 'default')->send($mybody)) {
                        $result['success'] = 1;
                    } else {
                        $result['success'] = -1;
                    }
                } catch (Exception $e) {
                    // Failure, with exception
                    $result['success'] = -2;
                }
                return $this->redirect(Router::url('/', true) . "contact");
            }
        }
        $this->layout = "main_front";
        $this->set('title_for_layout', $this->web_title);
        $this->set('contact_keyword', $this->contact_keyword);
        $this->set('contact_desc', $this->contact_desc);
        $this->set('contact', $result);
        $this->render($this->pathFront . 'contact');
    }
Exemplo n.º 5
0
 * @link http://phpbtree.com/captcha/
 * @copyright 2003-2005 Smart Friend Network, Inc.
 * @author Sol Toure <sol2ray at gmail dot com>
 * @version alpha 0.01;
 */
session_start();
error_reporting(E_ALL);
include_once 'util.php';
$MESSAGE = '&nbsp;';
$CAPTCHA_IMAGE_URI = 'captcha_image.php';
if (isset($_POST['code'])) {
    $text = isset($_SESSION[CAPTCHA_SESSION_KEY]) ? $_SESSION[CAPTCHA_SESSION_KEY] : NULL;
    if (!($p = trim($_POST['code']))) {
        $MESSAGE = '<div style="color: #FF0000;"><strong>Error</strong>: no code submited!!</div>';
    } else {
        if (!checkCaptchaCode($p)) {
            $MESSAGE = '<div style="color: #FF0000;"><strong>Error</strong>: Invalid code submited!!</div><div>YOUR CODE : "<strong>' . htmlentities(stripslashes($p)) . '</strong>"<br/> Code: "<strong>' . htmlentities(stripslashes($text)) . '</strong>"</div>';
        } else {
            $MESSAGE = '<strong style="color: #00CC99">Correct!!!</strong><br/> CODE:  "<strong>' . stripslashes($_POST['code']) . '</strong>"';
        }
    }
    $_SESSION[$CAPTCHA_SESSION_KEY] = NULL;
}
?>
<html>
<head>
<title>GOTCHA!</title>
</head>
<body>
<div><?php 
echo $MESSAGE;