|
0 / 0 / 0
Регистрация: 31.08.2016
Сообщений: 11
|
|
Скрипт как-то работает не правильно, подскажите в чем дело15.09.2016, 06:45. Показов 703. Ответов 5
Метки нет (Все метки)
на сайте есть скрипт обратной связи, получается если клиент пишет свой e-mail и нажимает отправить сообшение мне на почту не приходит. и так происходит не со всеми e-mail, некоторые приходят сообщения
Добавлено через 2 минуты вот скрипт может здесь что то не так case 'email': email = checkField($("#email"), /^[0-9a-zA-Z]+[@]+[A-Za-z0-9]+[.]+[A-Za-z0-9]/i, -1); $("#fsi_message_email").css('display', email ? 'none' : 'block'); break;
0
|
|
| 15.09.2016, 06:45 | |
|
Ответы с готовыми решениями:
5
Подскажите, в чем дело Подскажите в чём дело? IP. Подскажите в чем дело |
|
Фрилансер
735 / 352 / 96
Регистрация: 05.05.2014
Сообщений: 2,621
|
|
| 15.09.2016, 11:02 | |
|
Этот скрипт вообще ничего не отправляет, если судить по наименованиям ф-ций. Неизвестно что делает ф-ция checkField.
Отправлять email нужно либо на сервере, либо через сторонний сервис, например: mandrillapp.com. Последняя достаточно удобна и снижает нагрузку на свой сервер, но имеет место быть потеря конфиденциальности
0
|
|
|
0 / 0 / 0
Регистрация: 31.08.2016
Сообщений: 11
|
|
| 15.09.2016, 11:06 [ТС] | |
|
он перенаправляет на контактную форму
Добавлено через 2 минуты вот скрипе полностью jQuery(document).ready(function($) { if($("#fs_form")) { var is_serial = $("#serial").length > 0 ? true : false; var serial = false; var crum = false; var email = false; $("#fs_form input").change(function(e) { switch ($(e.target).attr('id')) { case 'serial': $("#serial").val($("#serial").val().toUp perCase()); var numbers = $("#serial").attr('maxlength'); console.log(numbers); serial = checkField($("#serial"), /^[A-Z0-9]+$/g, numbers); $("#fsi_message_serial").css('display' , serial ? 'none' : 'block'); break; case 'crum': $("#crum").val($("#crum").val().toUpperC ase()); crum = checkField($("#crum"), /^[A-Z0-9]+$/g, 11); $("#fsi_message_crum").css('display', crum ? 'none' : 'block'); break; case 'email': email = checkField($("#email"), /^[-0-9a-z_\.]+@[-0-9a-z_^\.]+\.[a-z]/i, -1); $("#fsi_message_email").css('display', email ? 'none' : 'block'); break; } }); $("#fo_submit").click(function(e) { console.log('serial: ' + serial); console.log('crum: ' + crum); console.log('email: ' + email); if(is_serial ? serial : 1 && crum && email) { $("#fsi_message_submit").css('display' , 'none'); var data = { 'action': 'sendorder_action', 'serial': $("#serial").val(), 'crum': $("#crum").val(), 'email': $("#email").val(), 'post_id': $("#post_id").val(), 'check': $("#check").val(), }; jQuery.post(ajax_object.ajax_url, data, function(response) { if(response) { $("#fsi_message_submit_success").css('di splay', 'block'); $("#fsi_message_submit_success").html(re sponse.toString()); } }); } else { $("#fsi_message_submit_error").css('disp lay', 'block'); $("#fsi_message_submit_success").css('di splay', 'none'); } }); } }); /** * Проверяет поле по регулярному выражению * * @param {object} input_obj Объект моля input. * @param {RegExp object} reg Регулярное выражение, в соответствии с которым будет вестись проверка. * @param {int} len Длина строки. Передайте -1, если не надо проверять длину * @return {bool} true - поле валидно, false - поле не валидно. */ function checkField(input_obj, reg, len){ if(len == -1) return reg.test(input_obj.val()); else return input_obj.val().length == len && reg.test(input_obj.val()); }
0
|
|
|
Фрилансер
735 / 352 / 96
Регистрация: 05.05.2014
Сообщений: 2,621
|
||||||
| 15.09.2016, 11:10 | ||||||
|
rashidk1, здесь происходит отправка на сервер:
0
|
||||||
|
4 / 4 / 4
Регистрация: 14.03.2016
Сообщений: 38
|
||||||
| 15.09.2016, 11:15 | ||||||
|
вы предоставляете минимум полезной инфы-- и ожидаете получить ответ--вы представили огрызок кода по которому можно только одно ответить---проверте регулярку которая проверяет мэйл
вот с харба
0
|
||||||
|
0 / 0 / 0
Регистрация: 31.08.2016
Сообщений: 11
|
|
| 15.09.2016, 11:44 [ТС] | |
|
у вас есть аська сможете помочь?
Добавлено через 22 минуты можете посмотреть может здесь есть ошибки <?php class WPCF7_Mail { private static $current = null; private $name = ''; private $template = array(); public static function send( $template, $name = '' ) { $instance = new self; $instance->name = trim( $name ); $instance->setup_template( $template ); self::$current = $instance; return $instance->compose(); } private function __construct() {} public function name() { return $this->name; } public static function get_current() { return self::$current; } private function setup_template( $template ) { $defaults = array( 'subject' => '', 'sender' => '', 'body' => '', 'recipient' => '', 'additional_headers' => '', 'attachments' => '', 'use_html' => false, 'exclude_blank' => false ); $this->template = wp_parse_args( $template, $defaults ); } private function compose( $send = true ) { $template = $this->template; $use_html = (bool) $template['use_html']; $subject = $this->replace_tags( $template['subject'] ); $sender = $this->replace_tags( $template['sender'] ); $recipient = $this->replace_tags( $template['recipient'] ); $additional_headers = $this->replace_tags( $template['additional_headers'] ); if ( $use_html ) { $body = $this->replace_tags( $template['body'], true ); $body = wpautop( $body ); } else { $body = $this->replace_tags( $template['body'] ); } $attachments = $this->attachments( $template['attachments'] ); $components = compact( 'subject', 'sender', 'body', 'recipient', 'additional_headers', 'attachments' ); $components = apply_filters( 'wpcf7_mail_components', $components, wpcf7_get_current_contact_form(), $this ); $subject = wpcf7_strip_newline( $components['subject'] ); $sender = wpcf7_strip_newline( $components['sender'] ); $recipient = wpcf7_strip_newline( $components['recipient'] ); $body = $components['body']; $additional_headers = trim( $components['additional_headers'] ); $attachments = $components['attachments']; $headers = "From: $sender\n"; if ( $use_html ) { $headers .= "Content-Type: text/html\n"; $headers .= "X-WPCF7-Content-Type: text/html\n"; } else { $headers .= "X-WPCF7-Content-Type: text/plain\n"; } if ( $additional_headers ) { $headers .= $additional_headers . "\n"; } if ( $send ) { return wp_mail( $recipient, $subject, $body, $headers, $attachments ); } $components = compact( 'subject', 'sender', 'body', 'recipient', 'headers', 'attachments' ); return $components; } public function replace_tags( $content, $html = false ) { $args = array( 'html' => $html, 'exclude_blank' => $this->template['exclude_blank'] ); return wpcf7_mail_replace_tags( $content, $args ); } private function attachments( $template ) { $attachments = array(); if ( $submission = WPCF7_Submission::get_instance() ) { $uploaded_files = $submission->uploaded_files(); foreach ( (array) $uploaded_files as $name => $path ) { if ( false !== strpos( $template, "[${name}]" ) && ! empty( $path ) ) { $attachments[] = $path; } } } foreach ( explode( "\n", $template ) as $line ) { $line = trim( $line ); if ( '[' == substr( $line, 0, 1 ) ) { continue; } $path = path_join( WP_CONTENT_DIR, $line ); if ( @is_readable( $path ) && @is_file( $path ) ) { $attachments[] = $path; } } return $attachments; } } function wpcf7_mail_replace_tags( $content, $args = '' ) { $args = wp_parse_args( $args, array( 'html' => false, 'exclude_blank' => false ) ); if ( is_array( $content ) ) { foreach ( $content as $key => $value ) { $content[$key] = wpcf7_mail_replace_tags( $value, $args ); } return $content; } $content = explode( "\n", $content ); foreach ( $content as $num => $line ) { $line = new WPCF7_MailTaggedText( $line, $args ); $replaced = $line->replace_tags(); if ( $args['exclude_blank'] ) { $replaced_tags = $line->get_replaced_tags(); if ( empty( $replaced_tags ) || array_filter( $replaced_tags ) ) { $content[$num] = $replaced; } else { unset( $content[$num] ); // Remove a line. } } else { $content[$num] = $replaced; } } $content = implode( "\n", $content ); return $content; } add_action( 'phpmailer_init', 'wpcf7_phpmailer_init' ); function wpcf7_phpmailer_init( $phpmailer ) { $wpcf7_content_type = false; foreach ( (array) $phpmailer->getCustomHeaders() as $custom_header ) { if ( 'X-WPCF7-Content-Type' == $custom_header[0] ) { $wpcf7_content_type = trim( $custom_header[1] ); break; } } if ( 'text/html' == $wpcf7_content_type ) { $phpmailer->msgHTML( $phpmailer->Body ); } } class WPCF7_MailTaggedText { private $html = false; private $callback = null; private $content = ''; private $replaced_tags = array(); public function __construct( $content, $args = '' ) { $args = wp_parse_args( $args, array( 'html' => false, 'callback' => null ) ); $this->html = (bool) $args['html']; if ( null !== $args['callback'] && is_callable( $args['callback'] ) ) { $this->callback = $args['callback']; } elseif ( $this->html ) { $this->callback = array( $this, 'replace_tags_callback_html' ); } else { $this->callback = array( $this, 'replace_tags_callback' ); } $this->content = $content; } public function get_replaced_tags() { return $this->replaced_tags; } public function replace_tags() { $regex = '/(\[?)\[[\t ]*' . '([a-zA-Z_][0-9a-zA-Z:._-]*)' // [2] = name . '((?:[\t ]+"[^"]*"|[\t ]+\'[^\']*\')*)' // [3] = values . '[\t ]*\](\]?)/'; return preg_replace_callback( $regex, $this->callback, $this->content ); } private function replace_tags_callback_html( $matches ) { return $this->replace_tags_callback( $matches, true ); } private function replace_tags_callback( $matches, $html = false ) { // allow [[foo]] syntax for escaping a tag if ( $matches[1] == '[' && $matches[4] == ']' ) { return substr( $matches[0], 1, -1 ); } $tag = $matches[0]; $tagname = $matches[2]; $values = $matches[3]; if ( ! empty( $values ) ) { preg_match_all( '/"[^"]*"|\'[^\']*\'/', $values, $matches ); $values = wpcf7_strip_quote_deep( $matches[0] ); } $do_not_heat = false; if ( preg_match( '/^_raw_(.+)$/', $tagname, $matches ) ) { $tagname = trim( $matches[1] ); $do_not_heat = true; } $format = ''; if ( preg_match( '/^_format_(.+)$/', $tagname, $matches ) ) { $tagname = trim( $matches[1] ); $format = $values[0]; } $submission = WPCF7_Submission::get_instance(); $submitted = $submission ? $submission->get_posted_data( $tagname ) : null; if ( null !== $submitted ) { if ( $do_not_heat ) { $submitted = isset( $_POST[$tagname] ) ? $_POST[$tagname] : ''; } $replaced = $submitted; if ( ! empty( $format ) ) { $replaced = $this->format( $replaced, $format ); } $replaced = wpcf7_flat_join( $replaced ); if ( $html ) { $replaced = esc_html( $replaced ); $replaced = wptexturize( $replaced ); } $replaced = apply_filters( 'wpcf7_mail_tag_replaced', $replaced, $submitted, $html ); $replaced = wp_unslash( trim( $replaced ) ); $this->replaced_tags[$tag] = $replaced; return $replaced; } $special = apply_filters( 'wpcf7_special_mail_tags', '', $tagname, $html ); if ( ! empty( $special ) ) { $this->replaced_tags[$tag] = $special; return $special; } return $tag; } public function format( $original, $format ) { $original = (array) $original; foreach ( $original as $key => $value ) { if ( preg_match( '/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $value ) ) { $original[$key] = mysql2date( $format, $value ); } } return $original; } } /* Special Mail Tags */ add_filter( 'wpcf7_special_mail_tags', 'wpcf7_special_mail_tag', 10, 3 ); function wpcf7_special_mail_tag( $output, $name, $html ) { $name = preg_replace( '/^wpcf7\./', '_', $name ); // for back-compat $submission = WPCF7_Submission::get_instance(); if ( ! $submission ) { return $output; } if ( '_remote_ip' == $name ) { if ( $remote_ip = $submission->get_meta( 'remote_ip' ) ) { return $remote_ip; } else { return ''; } } if ( '_user_agent' == $name ) { if ( $user_agent = $submission->get_meta( 'user_agent' ) ) { return $html ? esc_html( $user_agent ) : $user_agent; } else { return ''; } } if ( '_url' == $name ) { if ( $url = $submission->get_meta( 'url' ) ) { return esc_url( $url ); } else { return ''; } } if ( '_date' == $name || '_time' == $name ) { if ( $timestamp = $submission->get_meta( 'timestamp' ) ) { if ( '_date' == $name ) { return date_i18n( get_option( 'date_format' ), $timestamp ); } if ( '_time' == $name ) { return date_i18n( get_option( 'time_format' ), $timestamp ); } } return ''; } if ( '_post_' == substr( $name, 0, 6 ) ) { $unit_tag = $submission->get_meta( 'unit_tag' ); if ( $unit_tag && preg_match( '/^wpcf7-f(\d+)-p(\d+)-o(\d+)$/', $unit_tag, $matches ) ) { $post_id = absint( $matches[2] ); if ( $post = get_post( $post_id ) ) { if ( '_post_id' == $name ) { return (string) $post->ID; } if ( '_post_name' == $name ) { return $post->post_name; } if ( '_post_title' == $name ) { return $html ? esc_html( $post->post_title ) : $post->post_title; } if ( '_post_url' == $name ) { return get_permalink( $post->ID ); } $user = new WP_User( $post->post_author ); if ( '_post_author' == $name ) { return $user->display_name; } if ( '_post_author_email' == $name ) { return $user->user_email; } } } return ''; } return $output; } ?>
0
|
|
| 15.09.2016, 11:44 | |
|
Помогаю со студенческими работами здесь
6
собрал компьютер, все крутится(бп, кулер, видео, жд), но не работает.как выяснить в чем дело? Подскажите, в чем дело с контейнерами Греется ноутбук, подскажите в чем дело? Подскажите как правильно написать скрипт Не работает СИ в чем дело? Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |
|
Новые блоги и статьи
|
|||
|
Уведомление о неверно выбранном значении справочника
Maks 06.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа "НарядПутевка", разработанного в конфигурации КА2.
Задача: уведомлять пользователя, если в документе выбран неверный склад. . .
|
Установка Qt Creator для C и C++: ставим среду, CMake и MinGW без фреймворка Qt
8Observer8 05.04.2026
Среду разработки Qt Creator можно установить без фреймворка Qt. Есть отдельный репозиторий для этой среды: https:/ / github. com/ qt-creator/ qt-creator, где можно скачать установщик, на вкладке Releases:. . .
|
AkelPad-скрипты, структуры, и немного лирики..
testuser2 05.04.2026
Такая программа, как AkelPad существует уже давно, и также давно существуют скрипты под нее. Тем не менее, прога живет, периодически что-то не спеша дополняется, улучшается. Что меня в первую очередь. . .
|
Отображение реквизитов в документе по условию и контроль их заполнения
Maks 04.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа "ПланированиеСпецтехники", разработанного в конфигурации КА2.
Данный документ берёт данные из другого нетипового документа. . .
|
|
Фото всей Земли с борта корабля Orion миссии Artemis II
kumehtar 04.04.2026
Это первое подобное фото сделанное человеком за 50 лет. Снимок называют новым вариантом легендарной фотографии «The Blue Marble» 1972 года, сделанной с борта корабля «Аполлон-17». Новое фото. . .
|
Вывод диалогового окна перед закрытием, если документ не проведён
Maks 04.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа "СписаниеМатериалов", разработанного в конфигурации КА2.
Задача: реализовать программный контроль на предмет проведения документа. . .
|
Программный контроль заполнения реквизитов табличной части документа
Maks 02.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа "СписаниеМатериалов", разработанного в конфигурации КА2.
Задача:
1. Реализовать контроль заполнения реквизита. . .
|
wmic не является внутренней или внешней командой
Maks 02.04.2026
Решение:
DISM / Online / Add-Capability / CapabilityName:WMIC~~~~
Отсюда: https:/ / winitpro. ru/ index. php/ 2025/ 02/ 14/ komanda-wmic-ne-naydena/
|