wmaraci reklam
lidertakipci

PHP Rezervasyon formunu çalıştıramıyorum

5 Mesajlar 863 Okunma
advertseo
wmaraci reklam

orchidologist orchidologist WM Aracı Kullanıcı
  • Üyelik 12.09.2014
  • Yaş/Cinsiyet 39 / E
  • Meslek Emekli
  • Konum Çanakkale
  • Ad Soyad K** H**
  • Mesajlar 3
  • Beğeniler 0 / 0
  • Ticaret 0, (%0)
Herkese selamlar,
Öncelikle yardımlarınız için şimdiden teşekkür ederim.
Bir otel sitesindeki php rezervasyon formunu çalıştıramıyorum.
Error sending acknowledgement of receipt mail.
Error sending admin mail.

hatası alıyorum.
Hazır bir rezervasyon scripti. Nasıl düzelteceğimi bana öğretebilecek birisinin yardımına ihtiyacım var. Teşekkürler.
 

 

wmaraci
reklam

muradinevi muradinevi WM Aracı Kullanıcı
  • Üyelik 16.12.2013
  • Yaş/Cinsiyet 49 / E
  • Meslek Grafik, Web Tasarım
  • Konum Manisa
  • Ad Soyad M** N**
  • Mesajlar 242
  • Beğeniler 93 / 78
  • Ticaret 0, (%0)
Jotform deneyin hocam
 

 

orchidologist orchidologist WM Aracı Kullanıcı
  • Üyelik 12.09.2014
  • Yaş/Cinsiyet 39 / E
  • Meslek Emekli
  • Konum Çanakkale
  • Ad Soyad K** H**
  • Mesajlar 3
  • Beğeniler 0 / 0
  • Ticaret 0, (%0)
Formla ilgili başka birşey sormak istiyorum. Form php ile mail göndermek istiyor fakat server'da bu özellik kapalı. php üzerinden SMTP kullanarak formun gönderilmesini sağlayın diyor.
Bunun için yardıma ihtiyacım var. Daha önce hiç kullanmadım.

Ek Olarak: Html template ile birlikte gelen reservation.php aşağıdaki şekilde.
Bunu smtp ile mail gönderecek şekilde nasıl düzenleyebilirim?

$email_admin = 'booking@askinartotel.com'; // Put your email here.
$enable_captcha = 'no'; // Put 'yes' if you want to enable captchas on the reservation forms.
$message_ar = 'yes'; // Put 'no' for no acknowledgement of receipt message.
$subject = 'Request for a reservation';
$output_error = '';
$message = '';
$name = '';
$email = '';
$tel = '';
$n_adults = 0;
$n_children = 0;
$type_room = '';
$check_in_date = '';
$check_out_date = '';
$message_reservation = '';
$captcha = '';
$li_name = '';
$li_message_reservation = '';

function is_valid_email_address($email){
$qtext = '[^\\x0d\\x22\\x5c\\x80-\\xff]';
$dtext = '[^\\x0d\\x5b-\\x5d\\x80-\\xff]';
$atom = '[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c'.
'\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+';
$quoted_pair = '\\x5c[\\x00-\\x7f]';
$domain_literal = "\\x5b($dtext|$quoted_pair)*\\x5d";
$quoted_string = "\\x22($qtext|$quoted_pair)*\\x22";
$domain_ref = $atom;
$sub_domain = "($domain_ref|$domain_literal)";
$word = "($atom|$quoted_string)";
$domain = "$sub_domain(\\x2e$sub_domain)*";
$local_part = "$word(\\x2e$word)*";
$addr_spec = "$local_part\\x40$domain";
return preg_match("!^$addr_spec$!", $email) ? 1 : 0;
}

if (isset($_POST['input-name'])) {
$name = stripslashes(strip_tags($_POST['input-name']));
}

if (isset($_POST['input-e-mail'])) {
$email = stripslashes(strip_tags($_POST['input-e-mail']));
}

if (isset($_POST['select-n-adults'])) {
$n_adults = stripslashes(strip_tags($_POST['select-n-adults']));
}

if (isset($_POST['select-n-children'])) {
$n_children = stripslashes(strip_tags($_POST['select-n-children']));
}

if (isset($_POST['select-type-of-room'])) {
$type_room = stripslashes(strip_tags($_POST['select-type-of-room']));
}

if (isset($_POST['input-check-in-date'])) {
$check_in_date = stripslashes(strip_tags($_POST['input-check-in-date']));
}

if (isset($_POST['input-check-out-date'])) {
$check_out_date = stripslashes(strip_tags($_POST['input-check-out-date']));
}

if (isset($_POST['textarea-reservation'])) {
$message_reservation = stripslashes(strip_tags($_POST['textarea-reservation']));
}

if (isset($_POST['input-captcha'])) {
$captcha = stripslashes(strip_tags($_POST['input-captcha']));
}

if ($name != '') {
$li_name = "
  • Name: $name
  • ";
    }

    if ($message_reservation != '') {
    $li_message_reservation = "
  • Message: $message_reservation
  • ";
    }

    $message =
    "

      $li_name
    • E-mail: $email

    • Number of adults: $n_adults

    • Number of children: $n_children

    • Type of room: $type_room

    • Check-in date: $check_in_date

    • Check-out date: $check_out_date

    • $li_message_reservation
    ";


    if ($message_ar == 'yes') {
    $message_ar = "

    Rezervasyonunuz için teşekkür ederiz. Thank you for your request for a reservation.



    Here are the details you have just submitted:


    $message


    We will see if we have something which suits your needs and come back to you shortly.

    See you soon!

    ";
    }

    $message_admin = "This is a request for a reservation:$message";

    $captcha_ok = true;
    if ($enable_captcha == 'yes') {
    session_start();
    if(($_SESSION['security_code'] == $captcha) && (!empty($_SESSION['security_code'])) ) {
    unset($_SESSION['security_code']);
    } else {
    $captcha_ok = false;
    }
    }
    if (!$captcha_ok) {
    $output_error = 'Error: you didn\'t enter the code correctly.';
    } else if (strlen(trim($_POST['input-e-mail'])) > 0) {
    if (is_valid_email_address($email)) {
    if ($message_ar != '') {
    $headers = 'From: ' . $email_admin . "\r\n" . 'Reply-To: ' . $email_admin . "\r\n" . 'Content-Type: text/html; charset="utf-8"' . "\r\n";
    if (!mail($email, $subject, $message_ar, $headers)) {
    $output_error = 'Error sending acknowledgement of receipt mail.
    ';
    }
    }
    $headers = 'From: ' . $email . "\r\n" . 'Reply-To: ' . $email . "\r\n" . 'Content-Type: text/html; charset="utf-8"' . "\r\n";
    if (!mail($email_admin, $subject, $message_admin, $headers)) {
    $output_error .= 'Error sending admin mail.';
    }
    } else {
    $output_error = 'Error: your e-mail is not valid.';
    }
    } else {
    $output_error = 'Error: no mail.';
    }

    if ($output_error == '') {
    echo("

    Thank you for your request for a reservation.



    Here are the details you have just submitted:


    $message


    We have sent you an e-mail with those details.
    We will see if we have something to suit your needs and will come back to you shortly.

    See you soon!

    ");
    } else {
    echo('' . $output_error . '');
    }
    ?>
     

     

    ozturkmtn ozturkmtn Work Intelligent. Kullanıcı
    • Üyelik 22.08.2015
    • Yaş/Cinsiyet 39 / E
    • Meslek Bilgisayar mühendisi
    • Konum Diğer
    • Ad Soyad M** Ö**
    • Mesajlar 47
    • Beğeniler 23 / 6
    • Ticaret 2, (%100)
    PHP Maıler yukleyin.
    daha sonra scrıptın maıl fonksıyonunu PHPMailer ile bağlayın.
    PHPMAİLER ın ayarlarını control paneldekı smtp ayarlarına göre güncelleyin olsun bitsin.
    :D
     

     

    wmaraci
    wmaraci

    pg13 pg13 Xcode. Kullanıcı
    • Üyelik 01.10.2013
    • Yaş/Cinsiyet 41 / E
    • Meslek BilişimTeknolojileri Mühendisi
    • Konum İstanbul Anadolu
    • Ad Soyad O** Ö**
    • Mesajlar 321
    • Beğeniler 72 / 101
    • Ticaret 11, (%100)
    sorun devam ediyorsa pm ile ulaşın yardımcı olayım.
     

     

    wmaraci
    Konuyu toplam 1 kişi okuyor. (0 kullanıcı ve 1 misafir)
    Site Ayarları
    • Tema Seçeneği
    • Site Sesleri
    • Bildirimler
    • Özel Mesaj Al