Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Formularz HTML php
Forum PHP.pl > Forum > Przedszkole
Gość_Wojtek
Witam,
chciałbym mieć na swojej stronie taki formularz:

[http://www.savcom.com.pl/formularz.html]

Męcze się już od wczoraj, ale nic nie wychodzi.

Plik index.html


  1. <meta name="Description" content="">
  2. <meta name="Keywords" content="">
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  4. </head>
  5. <body topmargin=100 rightmargin=100 leftmargin=200>
  6. T E S T M A I L E R</font><p>
  7. <div align="right"><form action="mailer.php" method=get>
  8. <input type="hidden" name="subject" value="Test Form Results">
  9. Name <input type="text" name="name" size=40 maxlength=40><br>
  10. E-Mail <input type="text" name="email" size=40 maxlength=40><br>
  11. <input type="submit" value="Submit">
  12.  
  13. </form></div>
  14.  
  15. </body>
  16. </html>



Plik mailer.php

  1. <?
  2. /* Form Mailer Program */
  3. /* Edit HTML at bottom of script for HTML output */
  4. /* Š2000 YOA/LSYF/YoAi */
  5.  
  6. $errorpage = "error.htm";
  7. $mailto = "niewiemcosiedzieje2@wp.pl";
  8. $required = array("subject","email"); // what do you wish to require?
  9.  
  10. // edit below this line at your own risk
  11.  
  12. $n = 0;
  13. do {
  14. $r = $required[$n];
  15. if(!$$r) {
  16. print Header("Location: $errorpage");
  17. }
  18. $n++;
  19. } while ($n != count($required));
  20.  
  21. $a = urldecode($QUERY_STRING);
  22. $a = str_replace("&","
  23.  
  24. ",$a);
  25. $a = str_replace("=",": ",$a);
  26. $a = str_replace("@","_AT_",$a);
  27. mail($mailto,$HTTP_GET_VARS["subject"],$a,"From: $mailto");
  28. ?>
  29. <html><head><title>Mail Sent</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  30. </head>
  31. <body>
  32. <h2>Mail sent.</h2>
  33. </body></html>



Mój e-mail niewiemcosiedzieje2@wp.pl
Chce, aby tam przychodziły dane z formularza.
Jak mam to zrobić?
Pozdrawiam


Poprawiłem
~mike_mech
skowron-line
  1. <?php
  2.  
  3. $tresc = "imie to :$name adres email to: $email";
  4. mail("niewiemcosiedzieje2@wp.pl", "Temat listu", "$tresc");
  5. ?>
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.