Пример #1
0
/**
 * page code function
 */
function PageCompPageMainCode()
{
    global $_page;
    global $site;
    $show_form = true;
    $action_result = _t("_FORGOT", $site['title']);
    ob_start();
    if ($_POST['Email']) {
        // Test if eneterd email is not valid
        if (!eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,4}\$", $_POST['Email'])) {
            $_page['header'] = _t("_Error");
            $_page['header_text'] = _t("_Incorrect Email");
            $action_result = _t("_INCORRECT_EMAIL");
        } else {
            // Check if entered email is in the base
            $sEmail = htmlspecialchars_adv($_POST['Email']);
            $memb_arr = db_arr("SELECT `ID` FROM `Profiles` WHERE `Email` = '{$sEmail}'");
            if ($memb_arr['ID']) {
                $recipient = $sEmail;
                $message = getParam("t_Forgot");
                $subject = getParam('t_Forgot_subject');
                generateNewPwd($memb_arr['ID']);
                $mail_ret = sendMail($recipient, $subject, $message, $memb_arr['ID']);
                $sQuery = "UPDATE `Profiles` SET `Password` = md5(`Password`) WHERE `ID`='{$memb_arr['ID']}'";
                db_res($sQuery);
                createUserDataFile($memb_arr['ID']);
                if (!$mail_ret) {
                    $_page['header'] = _t("_Recognized");
                    $_page['header_text'] = _t("_RECOGNIZED", $site['title']);
                    $action_result = _t("_MEMBER_RECOGNIZED_MAIL_NOT_SENT", $site['title']);
                    $show_form = false;
                }
                $_page['header'] = _t("_Recognized");
                $_page['header_text'] = _t("_RECOGNIZED", $site['title']);
                $action_result = _t("_MEMBER_RECOGNIZED_MAIL_SENT", $site['url'], $site['title']);
                $show_form = false;
            } else {
                $_page['header'] = _t("_Not Recognized");
                $_page['header_text'] = _t("_NOT_RECOGNIZED", $site['title']);
                $action_result = _t("_MEMBER_NOT_RECOGNIZED", $site['title']);
            }
        }
    }
    echo "<table width=\"100%\" cellpadding=4 cellspacing=4>\r\n\t\t\t<td align=center class=text2>\n";
    echo $action_result;
    if ($show_form) {
        send_form();
    }
    echo "\r\n\t\t\t</td></table>\n";
    $ret = ob_get_contents();
    ob_end_clean();
    return $ret;
}
Пример #2
0
    echo "<form action='tic.php' method='post'>\r\n\r\n<input type ='hidden' value='checkin' name='action' />\r\n<input type='text' size='35' name='url' />\r\n<input type='submit' value='проверить' />\r\n    </form>";
}
function yandex_tic($url)
{
    $file = file_get_contents("http://search.yaca.yandex.ru/yca/cy/ch/{$url}/");
    if (preg_match("!&#151;\\s+([0-9]{0,8})<\\/b>!is", $file, $ok)) {
        $str = $ok[1];
    } else {
        if (preg_match("!<td class=\"current\" valign=\"middle\">(.*?)</td>\n</tr>!si", $file, $ok)) {
            if (preg_match("!<td align=\"right\">(.*?)</td>\n</tr>!si", $ok[0], $str)) {
                $str = $str[1];
            } else {
                $str = 0;
            }
        } else {
            $str = 0;
        }
    }
    return trim($str);
}
if ($_POST['action'] === "checkin") {
    $site = $_POST['url'];
    echo yandex_tic($site);
} else {
    send_form();
}
?>
</div>
</body>
</html>
Пример #3
0
<?php

//  Author: Trabis
//  URL: http://www.xuups.com
//  E-Mail: lusopoemas@gmail.com
require dirname(__FILE__) . '/admin_header.php';
$op = isset($_GET['op']) ? trim($_GET['op']) : (isset($_POST['op']) ? trim($_POST['op']) : 'form');
switch ($op) {
    case 'email':
        send_email();
        break;
    case 'form':
    default:
        xoops_cp_header();
        subscribers_adminMenu(1, _MI_SUBSCRIBERS_ADMENU_SEND);
        echo send_form();
        xoops_cp_footer();
        break;
}
function send_form()
{
    global $xoopsModuleConfig;
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    $this_handler =& xoops_getModuleHandler('user', 'subscribers');
    $form = new XoopsThemeForm(_AM_SUBSCRIBERS_SEND, 'send_form', 'admin_send.php', "post");
    $element = new XoopsFormLabel(_MI_SUBSCRIBERS_CONF_FROMNAME, $xoopsModuleConfig['fromname']);
    $form->addElement($element);
    unset($element);
    $element = new XoopsFormLabel(_MI_SUBSCRIBERS_CONF_FROMEMAIL, $xoopsModuleConfig['fromemail']);
    $form->addElement($element);
    unset($element);
Пример #4
0
function process_feedback(&$errors, &$name, &$email, &$feedback)
{
    $name = trim(isset($_POST['name']) ? (string) $_POST['name'] : '');
    $email = trim(isset($_POST['email']) ? (string) $_POST['email'] : '');
    $feedback = trim(isset($_POST['feedback']) ? (string) $_POST['feedback'] : '');
    if (empty($name)) {
        array_push($errors, 'name');
    }
    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
        array_push($errors, 'email');
    }
    if (empty($feedback)) {
        array_push($errors, 'feedback');
    }
    if (!empty($errors)) {
        return;
    }
    session_start();
    if (empty($_SESSION['authenticity_token']) || $_GET['authenticity_token'] !== $_SESSION['authenticity_token']) {
        return;
    }
    send_form($name, $email, $feedback);
    unset($_SESSION['authenticity_token']);
}
Пример #5
0
 //email content
 $_link = "http://cartoonbank.ru/?page_id=29&amp;brand=" . $brand;
 $content = "Автор: " . $author . "\n\r";
 $content .= "Название: " . $title . "\n\r";
 $content .= $_link . "\n\r";
 $content .= "Код ссылки на страницу автора: <a href='" . $_link . "'>" . $author . "</a>\n\r";
 $my_file = $slidename;
 //$my_file = "/home/www/cb3/ales/test.gif";
 $my_path = $_SERVER['DOCUMENT_ROOT'] . "ales/";
 $my_name = "cartoonbank";
 $my_mail = "*****@*****.**";
 $my_replyto = "*****@*****.**";
 $my_subject = "ежедневная карикатура для анекдота.ру от картунбанка.ру";
 $my_message = $content;
 // send data to remote form
 send_form($url, $title, $author, $my_mail, $_link, $my_file);
 $count = $count - 1;
 //send email
 // self
 mail_attachment($my_file, $my_path, $mailto, $my_mail, $my_name, $my_replyto, $my_subject, $my_message);
 // verner
 //mail_attachment($my_file, $my_path, $mailto1, $my_mail, $my_name, $my_replyto, $my_subject, $my_message);
 // kalininsky
 //mail_attachment($my_file, $my_path, $mailto2, $my_mail, $my_name, $my_replyto, $my_subject, $my_message);
 if (file_exists($export_dir . $slidename)) {
     unlink($export_dir . $slidename);
 }
 /*
 					// Mark image as sent to the Anekdot.ru
 					$update_sql = "update wp_fsr_post set anekdotru_date='".date("d.m.y H:m:s")."' where ID=".$ID;
 						$res = mysql_query($update_sql);
Пример #6
0
 function display($con)
 {
     control_begin('temp', $this->title);
     $temp = "20";
     if ($this->stateaddr != "" && ($r = fetchstats($con, $this->stateaddr, $this->age))) {
         if (count($r) == 2) {
             $temp = f2_decode($r);
             printf("%s °C", $temp);
         }
     }
     control_main();
     if ($this->tempaddr != "") {
         send_form("Send", $this->tempaddr, "f2", $temp, 1);
     }
     control_end();
 }