Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

geras

Newbie
  
  • Posts

    2
  • Joined

  • Last visited

Information

  • Gender
    Не определился

Recent Profile Visitors

606 profile views

geras's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. $('.callback_modal form input').mask('+38 000-00-000-00'); $(document).on('submit', '.callback_modal form', function (e) { e.preventDefault(); let phone = $(this).find('input').val(); if (phone.length > 16) { $.ajax({ type: "POST", url: "index.php?route=information/callback", data: { phone: phone }, success: () => { $(this).html('<p>Ожидайте, скоро Вам перезвонят)</p>') } }) } else { alert('Телефон введен не верно') } }); /catalog/controller/information/callback.php class ControllerInformationCallback extends Controller { public function index() { $this->load->model( 'catalog/information' ); if ( ($this->request->server['REQUEST_METHOD'] == 'POST') ) { $mail = new Mail(); $mail->protocol = $this->config->get( 'config_mail_protocol' ); $mail->parameter = $this->config->get( 'config_mail_parameter' ); $mail_to = $this->config->get( 'config_email' ); // $mail_to = '[email protected]'; $mail->setTo( $mail_to ); $mail->setFrom( '[email protected]' ); $mail->setSender( 'Алюминий укр' ); $mail->setSubject( 'Callback' ); $mail->setText( strip_tags( html_entity_decode( $this->request->post['phone'], ENT_QUOTES, 'UTF-8' ) ) ); if ( isset( $this->request->post['phone'] ) ) { $mail->send(); } } if ( isset( $this->request->post['phone'] ) ) { print_r( [ 'success' ] ); } else { print_r( [ 'error' ] ); } } }
  2. Я скажу Вам так что эту тему создал Рак))) как минимум ajax Url должен быть url: "index.php?route=information/callback", и у него много лишних функцию которые на стороне юзера можно проверить)
Guest
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.