当前位置: 首页>>代码示例>>PHP>>正文


PHP BYT_Theme_Utils::decrypt方法代码示例

本文整理汇总了PHP中BYT_Theme_Utils::decrypt方法的典型用法代码示例。如果您正苦于以下问题:PHP BYT_Theme_Utils::decrypt方法的具体用法?PHP BYT_Theme_Utils::decrypt怎么用?PHP BYT_Theme_Utils::decrypt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BYT_Theme_Utils的用法示例。


在下文中一共展示了BYT_Theme_Utils::decrypt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: wp_kses

$contact_message = '';
$contact_email = '';
$contact_name = '';
if (isset($_POST['contact_submit'])) {
    $form_submitted = true;
    if (empty($_POST) || !wp_verify_nonce($_POST['contact_form_nonce'], 'contact_form')) {
        // failed to verify nonce so exit.
        exit;
    } else {
        // process form data since nonce was verified
        $contact_message = wp_kses($_POST['contact_message'], '');
        $contact_email = wp_kses($_POST['contact_email'], '');
        $contact_name = wp_kses($_POST['contact_name'], '');
        $c_val_s = intval(wp_kses($_POST['c_val_s'], ''));
        $c_val_1 = intval(BYT_Theme_Utils::decrypt(wp_kses($_POST['c_val_1'], ''), $enc_key));
        $c_val_2 = intval(BYT_Theme_Utils::decrypt(wp_kses($_POST['c_val_2'], ''), $enc_key));
        if ($add_captcha_to_forms && $c_val_s != $c_val_1 + $c_val_2) {
            $contact_error = __('Invalid captcha, please try again!', 'bookyourtravel');
        } else {
            if (!empty($contact_name) && !empty($contact_email) && !empty($contact_message)) {
                $email_to = get_option('admin_email');
                if (!empty($business_contact_email)) {
                    $email_to = $business_contact_email;
                }
                $subject = sprintf(__('Contact form submission from %s', 'bookyourtravel'), $contact_name);
                $body = sprintf(__("Name: %s\n\nEmail: %s\n\nMessage: %s", 'bookyourtravel'), $contact_name, $contact_email, $contact_message);
                $headers = 'From: ' . $contact_name . ' <' . $contact_email . '>' . "\r\n" . 'Reply-To: ' . $contact_email;
                wp_mail($email_to, $subject, $body, $headers);
            } else {
                $contact_error = __('To submit contact form, please enable JavaScript', 'bookyourtravel');
            }
开发者ID:alikris,项目名称:OTA,代码行数:31,代码来源:page-contact.php

示例2: inquiry_ajax_request

 function inquiry_ajax_request()
 {
     global $byt_theme_globals;
     if (isset($_REQUEST)) {
         $enc_key = $byt_theme_globals->get_enc_key();
         $add_captcha_to_forms = $byt_theme_globals->add_captcha_to_forms();
         $your_name = wp_kses($_REQUEST['your_name'], '');
         $your_email = wp_kses($_REQUEST['your_email'], '');
         $your_phone = wp_kses($_REQUEST['your_phone'], '');
         $your_message = wp_kses($_REQUEST['your_message'], '');
         $postId = intval(wp_kses($_REQUEST['postId'], ''));
         $user_id = intval(wp_kses($_REQUEST['userId'], ''));
         $c_val_s = intval(wp_kses($_REQUEST['c_val_s'], ''));
         $c_val_1_str = BYT_Theme_Utils::decrypt(wp_kses($_REQUEST['c_val_1'], ''), $enc_key);
         $c_val_2_str = BYT_Theme_Utils::decrypt(wp_kses($_REQUEST['c_val_2'], ''), $enc_key);
         $c_val_1 = intval($c_val_1_str);
         $c_val_2 = intval($c_val_2_str);
         $nonce = $_REQUEST['nonce'];
         if (wp_verify_nonce($nonce, 'byt-ajax-nonce')) {
             if ($add_captcha_to_forms && $c_val_s != $c_val_1 + $c_val_2) {
                 echo 'captcha_error';
                 die;
             } else {
                 // nonce passed ok
                 $post = get_post($postId);
                 if ($post) {
                     $admin_email = get_bloginfo('admin_email');
                     $contact_email = get_post_meta($postId, $post->post_type . '_contact_email', true);
                     $contact_emails = explode(';', $contact_email);
                     if (empty($contact_email)) {
                         $contact_emails = array($admin_email);
                     }
                     $subject = __('New inquiry', 'bookyourtravel');
                     $message = __("The following inquiry has just arrived: \n Name: %s \n Email: %s \n Phone: %s \n Message: %s \n Inquiring about: %s \n", 'bookyourtravel');
                     $message = sprintf($message, $your_name, $your_email, $your_phone, $your_message, $post->post_title);
                     $headers = array();
                     $headers[] = "MIME-Version: 1.0";
                     $headers[] = "Content-type: text/plain; charset=utf-8";
                     $headers[] = "From: " . get_bloginfo('name') . " <" . $admin_email . ">";
                     $headers[] = "Reply-To: " . get_bloginfo('name') . " <" . $admin_email . ">";
                     $headers[] = "X-Mailer: PHP/" . phpversion();
                     $headers_str = implode("\r\n", $headers);
                     foreach ($contact_emails as $email) {
                         if (!empty($email)) {
                             wp_mail($email, $subject, $message, $headers_str, '-f ' . $admin_email);
                         }
                     }
                 }
             }
         }
     }
     // Always die in functions echoing ajax content
     die;
 }
开发者ID:JDjimenezdelgado,项目名称:old-mmexperience,代码行数:54,代码来源:theme_ajax.php


注:本文中的BYT_Theme_Utils::decrypt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。