Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [HTML][PHP]Problem z formularzem do wysyłania emaila
ABDOO
post 15.02.2013, 17:18:40
Post #1





Grupa: Zarejestrowani
Postów: 45
Pomógł: 0
Dołączył: 11.02.2013

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


Do kodu ktml wstawiony jest następujący kod:
  1. <form method="POST" action="sendmail.php">
  2. E-mail adress:<br>
  3. <input type="text" name="adres" size="40" /><br>
  4. Submit your inquiry:<br />
  5. <textarea name="tresc" rows="5" cols="30"> </textarea><br>
  6. <input type="submit" value="Send"/>
  7. </form>


Podczas gdy plik: sendmail.php wygląda tak:
  1. <?php
  2.  
  3. $do = "info@abdoo-webdesign.com";
  4.  
  5. if( isset($_REQUEST['adres']) && isset($_REQUEST['tresc']) )
  6. {
  7. $temat = $_REQUEST['adres'];
  8.  
  9. $tresc = $_REQUEST['tresc'];
  10.  
  11. if($adres == "" || $tresc == "")
  12. {
  13.  
  14. echo "<br /><br />Data not complete";
  15.  
  16. }
  17. else{
  18.  
  19. if( mail($do, $adres, $tresc) ){
  20.  
  21. echo "<br /><br />E-mail send succesfully. <br /><br />Thank you for your message, we will contact you as soon as possible.";
  22. }
  23.  
  24. else{
  25.  
  26. echo "<br /><br />E-mail was not send.";
  27. }
  28. }
  29. }
  30. else{
  31.  
  32. echo("<br /><br />Uncomplete data");
  33.  
  34. }
  35.  
  36. ?>


Po wstawieniu strony z formularzem i probie wyslania maila, pojawia sie komunikat:
"Notice: Undefined variable: adres in G:\xampp\htdocs\webdesign\sendmail.php on line 12


Data not complete"

Czy ktoś może mi pomóc w rozwiązaniu problemu?
Go to the top of the page
+Quote Post
nospor
post 15.02.2013, 17:30:38
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




nie: $temat = $_REQUEST['adres'];
a: $adres = $_REQUEST['adres'];

Nie wspomnie juz o tym, że komunikat bledu dosc wyraźnie ci to mowi


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
ABDOO
post 15.02.2013, 19:03:05
Post #3





Grupa: Zarejestrowani
Postów: 45
Pomógł: 0
Dołączył: 11.02.2013

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


no i działa... dziękuję ślicznie
nospor po raz kolejny smile.gif
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: 6.07.2025 - 02:14