Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][PHP]Formularz kontaktowy
Klaudiaaa
post
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 24.06.2019

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


Proszę o pomoc. Chcę zrobić formularz kontaktowy. Wzorowałam się na tutorialu na youtubie ale nie działa. Próbowałam na localhost i na githubie. Poniżej wklejam kod php i kawałek html.

  1.  
  2. <?php
  3. $to = 'mojmail@onet.pl';
  4. $name = $_POST['name'];
  5. $surname = $_POST['surname'];
  6. $email = $_POST['email'];
  7. $subject = 'Nowy e-mail od ' . $name . ' (' . $email . ')';
  8. $message = $_POST['message'];
  9. $headers = 'From: ' . $name . ' (' . $email . ')';
  10. $headers .= 'Content-Type: text/html; charset=utf-8';
  11. mail($to, $subject, $message, $headers);
  12. echo '<h1>Wiadomość wysłana :)</h1>';
  13. ?>
  14.  



  1.  
  2. <form method="post" name="contactform" action="mail.php">
  3. <div class="inputBox">
  4.  
  5. <input type="text" name="name" id="name" required="">
  6. <label for="name">imię</label>
  7.  
  8. </div>
  9.  
  10. <div class="inputBox">
  11.  
  12. <input type="text" name="surname" id="surname" required="">
  13. <label for="surname">nazwisko</label>
  14.  
  15.  
  16. </div>
  17.  
  18. <div class="inputBox">
  19.  
  20. <input type="text" name="email" id="email" required="">
  21. <label for="email">e-mail</label>
  22.  
  23.  
  24. </div>
  25.  
  26. <div class="inputBox">
  27. <input type="text" name="message" id="message" required="">
  28. <label>wiadomość</label>
  29.  
  30. </div>
  31.  
  32. <input type="submit" name="submit" value="wyślij" class="special">
  33.  
  34. </form>
  35.  
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: 23.12.2025 - 04:27