Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [HTML][PHP]Formularz kontaktowy
Klaudiaaa
post 24.06.2019, 19:00:15
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
dublinka
post 24.06.2019, 19:05:56
Post #2





Grupa: Zarejestrowani
Postów: 594
Pomógł: 66
Dołączył: 22.02.2008
Skąd: Dublin

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


Ale co nie dziala. Na localhoscie jesli nie jest skonfigurowane poprawnie to mail nie zadziala. Wrzuc to na serwer gdzies i sprawdz. Ten przyklad powinien dzialac.

Ten post edytował dublinka 24.06.2019, 19:09:23


--------------------
Go to the top of the page
+Quote Post
Klaudiaaa
post 24.06.2019, 19:16:26
Post #3





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

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


Wrzuciłam na GitHub Pages. Tu też trzeba coś skonfigurować?
Go to the top of the page
+Quote Post
dublinka
post 24.06.2019, 19:30:27
Post #4





Grupa: Zarejestrowani
Postów: 594
Pomógł: 66
Dołączył: 22.02.2008
Skąd: Dublin

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


Ja nie wiem. Nie znam tego.


--------------------
Go to the top of the page
+Quote Post
Klaudiaaa
post 24.06.2019, 20:10:17
Post #5





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

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


Skorzystałam z tej strony https://www.prv.pl/ ale na maila dalej nic nie przychodzi
Go to the top of the page
+Quote Post
dublinka
post 24.06.2019, 20:36:21
Post #6





Grupa: Zarejestrowani
Postów: 594
Pomógł: 66
Dołączył: 22.02.2008
Skąd: Dublin

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


https://www.prv.pl/pomoc-faq/101,mam-proble...ca-funkcji-mail

Olej te prv.pl

Tu masz jakis chyba normalny

https://www.ugu.pl

Choc do testów normalny.

Ten post edytował dublinka 24.06.2019, 20:39:23


--------------------
Go to the top of the page
+Quote Post
Klaudiaaa
post 25.06.2019, 07:09:16
Post #7





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

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


Dalej nie działa
Go to the top of the page
+Quote Post
dublinka
post 25.06.2019, 12:21:55
Post #8





Grupa: Zarejestrowani
Postów: 594
Pomógł: 66
Dołączył: 22.02.2008
Skąd: Dublin

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


To wrzuc cale toto co dajesz na serwer.


--------------------
Go to the top of the page
+Quote Post
SmokAnalog
post 25.06.2019, 12:36:55
Post #9





Grupa: Zarejestrowani
Postów: 1 707
Pomógł: 266
Dołączył: 3.07.2012
Skąd: Poznań

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


Przetestuj po prostu czy funkcja mail() działa na Twoim serwerze. Wrzuć goły kod, który tylko wysyła mail i sprawdź też, co funkcja mail() u Ciebie zwraca. Nie ma sensu zwiększać prawdopodobieństwa, że gdzieś po drodze jest dodatkowy błąd bez pewności czy mail() w ogóle jest wspierany przez Twój serwer.
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 29.03.2024 - 15:30