Ocena wątku:
  • 1 głosów - średnia: 1
  • 1
  • 2
  • 3
  • 4
  • 5
Formularz kontaktowy pytanie z PHP
#1
Witam,

Mam problem z kodem w formularzu, ponieważ w wysyłanych mailach otrzymuje krzaczki. Próbowałem już chyba wszystkich znalezionych w sieci rozwiązań, ale żadne nie pomogło. Wrzucę kody ze strony oraz pliku php.

Kod JavaScript
Kod:
$(document).ready(function() {

$("#form1").validationEngine({
    ajaxSubmit: true,
                    ajaxSubmitFile: "ajaxSubmit.php",
                    ajaxSubmitMessage: "Dziękujemy za wiadomość!",
                success :  false,
                failure : function() {}
    })
            

        
});

Kod ze strony html (body)
Kod:
<div id="wrapper">
  <div id="form-div">
    <form class="form" id="form1">
      <p class="name">
        <input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] text-input" id="name" value=""/>
        <label for="name">Imię</label>
      </p><br />
      <p class="email">
        <input name="email" type="text" class="validate[required,custom[email]] text-input" id="email" value=""/>
        <label for="email">e-Mail</label>
      </p><br />
      <p class="web">
        <input type="text" name="web" id="web"/>
        <label for="web">Temat</label>
      </p><br />
      <p class="text">
        <textarea name="text" class="validate[required,length[6,300]] text-input" id="comment"></textarea>
      </p><br />
      <p class="submit">
        <input type="submit" value="Wyślij" />
      </p>
    </form>

  </div>
</div>

oraz z pliku ajaxSubmit.php

Kod:
<?php

$name = $_POST['name']; // contain name of person
$email = $_POST['email']; // Email address of sender
$temat = $_POST['temat']; // Your website URL
$body = $_POST['text']; // Your message
$receiver = "[email protected]" ; // hardcorde your email address here - This is the email address that all your feedbacks will be sent to
if (!empty($name) & !empty($email) && !empty($body)) {
    $body = "Imię:{$name}\n\nTemat :{$web}\n\nTreść:{$body}\n\nMail:{$email}";
    $send = mail($receiver, 'Formularz kontaktowy', $body, "Od: {$email}");
    if ($send) {
        echo 'true'; //if everything is ok,always return true , else ajax submission won't work
    }

}

?>

Strona ma kodowanie UTF-8 i polskie znaki na stronie są. Formularz wysyła normalnie, tylko krzaczy. Pomocy, cały dzień już przy tym spędziłem.

Pozdrawiam,
Matissen
Odpowiedz


Wiadomości w tym wątku
Formularz kontaktowy pytanie z PHP - przez Matissen - 09-01-2012, 05:47

Podobne wątki…
Wątek: Autor Odpowiedzi: Wyświetleń: Ostatni post
  Formularz dodawania ogłoszenia tex 0 3,762 08-12-2015, 01:57
Ostatni post: tex
  Pytanie w mysl zktórym nie moge sobie poradzić Monaco 1 2,873 14-08-2013, 19:57
Ostatni post: mateo
  Formularz kontaktowy z checkbox Moody 4 3,506 26-08-2012, 13:59
Ostatni post: Marys
  [PHP] pytanie o include. cryptarithm 4 3,543 15-11-2011, 03:52
Ostatni post: cryptarithm
  Formularz PHP - brak polskich znaków heavy1123 4 3,977 27-10-2011, 02:30
Ostatni post: hieroshima

Skocz do:


Użytkownicy przeglądający ten wątek: 1 gości
Sponsorzy i przyjaciele
SeoHost.pl