Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Formularz kontaktowy
Sebastian003
post
Post #1





Grupa: Zarejestrowani
Postów: 282
Pomógł: 2
Dołączył: 22.03.2007

Ostrzeżenie: (0%)
-----


Jak zrobić zeby nie wysyłał emaila jak sie nie wypełni kazdego pola.

  1. <?php
  2. $adres="adres@wp.pl";
  3. $temat="jakis temat";
  4. $tresc="Imie/Nazwisko: ".$_POST["imienazwisko"]." |::| E-mail: ".$_POST["twojemail"]." |::| Wiadomosc: ".$_POST["tresc"].".";
  5.  
  6. if(function_exists('mail'))
  7. {
  8. mail($adres, $temat, $tresc);
  9. echo"<h1>Dziękujemy za wypełnienie formularza.<h1>";
  10. echo"<p>Skontatkujemy się z Państwem tak szybko, jak tylko będzie to możliwe.</p>";
  11. }
  12. else
  13. {
  14. echo"Niestety funkcja mail() jest wyłączona na tym serwerze. Nie mogę wysłać danych z formularza.";
  15. }
  16. ?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Sebastian003
post
Post #2





Grupa: Zarejestrowani
Postów: 282
Pomógł: 2
Dołączył: 22.03.2007

Ostrzeżenie: (0%)
-----


  1. <form id="test" action="send.php" method="post">
  2. <fieldset>
  3. <div>
  4. <label for="name_Req">Imię i nazwisko: </label>
  5. <input id="name_Req" type="text" title="Required! Please enter your name" name="imienazwisko">
  6. </div>
  7. <div>
  8. <label for="name_Req">Telefon lub e-mail:</label>
  9. <input id="name_Req" type="text" title="Required! Please enter your name" name="twojemail">
  10. </div>
  11. <div>
  12. <textarea id="message_Req" title="Required! Please enter your message" name="tresc"></textarea>
  13. </div>
  14. <div>
  15. <input class="button" type="submit" value="Wyślij">
  16. </div>
  17. </fieldset>
  18. </form>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 18.10.2025 - 11:05