Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [php][html]polskie znaki w formularzu
Forum PHP.pl > Forum > Przedszkole
Gidzior
hej

jestem zielony z tematyki PHP nigdy do tej pory nie miałem do czynienia z tym językiem, az do teraz kiedy potrzeba okazała się wyjątkowo silna, musiałem zrobić formularz kontaktowy, który wysyła maila ze strony z zapytaniem ofertowym, po wielu godzinach poszukiwań i testów rożnych formularz znalazłem wreszcie taki który potrafiłem przystosować do swoich potrzeb ale (hehehe niestety nie obeszło się bez ale) w mailu który przychodzi nie wyświetlają się polskie czcionki, ani w już wcześniej wpisanych nazwach pól takich jak np, "Wiadomość" ani z textboxow uzupełnianych na stronie,

jak mogę temu zaradzić, czy jest jakaś formułka która pozwoli na wyświetlanie polskich czcionek, proszę o łopatologiczne wyjaśnienie problemu ponieważ zaznaczam że nie jestem biegły w tym pięknym ojczystym języku jakim jest pehap

dzięki i pozdro
kosmowariat
utf8 ;-)
l0ud
Pewnie nie zadeklarowałeś kodowania jakie mają być w tych mailach. Daj najlepiej cały kod tego formularza i skryptu, bo w ciemno to ciężko poprawić.
Gidzior
kod obslugujacy formularz:
  1. <?
  2.  
  3. $required_on = "no";
  4.  
  5. $required_errorpage = "error.html";
  6.  
  7. $override = "no";
  8.  
  9. $incoming_mailto = "moj_mail@gmail.com";
  10.  
  11. $ban_ip_on = "no";
  12.  
  13. $ban_ip_list = "";
  14.  
  15. $secure_domain_on = "yes";
  16.  
  17. $autorespond_on = "no";
  18.  
  19. $autorespond_subject = "Your Form Submission";
  20.  
  21. $autorespond_from = "youremail@yoursite.com";
  22.  
  23. $autorespond_contents = "Your submission from our website has been received. Thank you!";
  24.  
  25. $autorespond_mailto_field = "Email";
  26.  
  27. // MAKE SURE DYNAFORM IS NOT BEING LOADED FROM THE URL
  28. if($HTTP_SERVER_VARS['REQUEST_METHOD'] == "GET") {
  29. echo "
  30. <html>
  31. <head><title>DynaForm is installed correctly.</title></head>
  32. <body>
  33. <font style='font-family: verdana, arial; font-size: 9pt;'>
  34. <b>DynaForm is installed correctly.</b></font>
  35. </body></html>
  36. ";
  37. exit();
  38. }
  39.  
  40. // SET VARIABLES
  41. $incoming_fields = array_keys($HTTP_POST_VARS);
  42. $incoming_values = array_values($HTTP_POST_VARS);
  43.  
  44. if($override == "no") {
  45. $incoming_mailto = @$HTTP_POST_VARS['rec_mailto'];
  46. $incoming_subject = @$HTTP_POST_VARS['rec_subject'];
  47. $incoming_thanks = @$HTTP_POST_VARS['rec_thanks'];
  48. }
  49.  
  50. $incoming_mailto_cc = @$HTTP_POST_VARS['opt_mailto_cc'];
  51. $incoming_mailto_bcc = @$HTTP_POST_VARS['opt_mailto_bcc'];
  52. $form_url = @$HTTP_REFERER;
  53.  
  54. // MAKE SURE DYNAFORM IS BEING RUN FROM THE RIGHT DOMAIN
  55. if($secure_domain_on == "yes") {
  56. $form_url_array = parse_url($form_url);
  57. $form_domain = $form_url_array[host];
  58. if($form_domain != $HTTP_SERVER_VARS[HTTP_HOST]) {
  59. echo "<h2>DynaForm Error - Invalid Domain</h2>
  60. You have accessed DynaForm from an external domain - this is not allowed.<br>
  61. You may only submit forms to a DynaForm file that exists on the same domain name
    .<br>
  62. If you believe to be receiving this message in error, please refer to your readm
    e.txt file.
  63. <br><br>";
  64. $error = "yes";
  65. }
  66. }
  67.  
  68. // CHECK IF MAILTO IS SET
  69. if($incoming_mailto == "") {
  70. echo "<h2>DynaForm Error - Missing Field</h2>
  71. Your form located at <a href='$form_url'>$form_url</a> does not work because you forgot to include
  72. the required \"<b>rec_mailto</b>\" field within the form. This field specifies who the email will
  73. be sent to.
  74. <br><br>
  75. This should look like:<br>
  76. <input type=\"hidden\" name=\"rec_mailto\" value=\"youremail@yoursite.com\">
  77. <br><br>
  78. If you are still confused, please refer to the readme.txt for more information a
    nd examples.<br><br><br><br>
  79. ";
  80. $error = "yes";
  81. }
  82.  
  83. // CHECK IF SUBJECT IS SET
  84. if($incoming_subject == "") {
  85. echo "<h2>DynaForm Error - Missing Field</h2>
  86. Your form located at <a href='$form_url'>$form_url</a> does not work because you forgot to include
  87. the required \"<b>rec_subject</b>\" field within the form. This field specifies the subject of
  88. the email that will be sent.
  89. <br><br>
  90. This should look like:<br>
  91. <input type=\"hidden\" name=\"rec_subject\" value=\"New DynaForm Email\">
  92. <br><br>
  93. If you are still confused, please refer to the readme.txt for more information a
    nd examples.<br><br><br><br>
  94. ";
  95. $error = "yes";
  96. }
  97.  
  98. // CHECK IF THANKS IS SET
  99. if($incoming_thanks == "") {
  100. echo "<h2>DynaForm Error - Missing Field</h2>
  101. Your form located at <a href='$form_url'>$form_url</a> does not work because you forgot to include
  102. the required \"<b>rec_thanks</b>\" field within the form. This field specifies what page the user
  103. will be taken to after they submit the form.
  104. <br><br>
  105. This should look like:<br>
  106. <input type=\"hidden\" name=\"rec_thanks\" value=\"thanks.html\">
  107. <br><br>
  108. If you are still confused, please refer to the readme.txt for more information a
    nd examples.<br><br><br><br>
  109. ";
  110. $error = "yes";
  111. }
  112.  
  113. // CHECK IF IP ADDRESS IS BANNED
  114. if($ban_ip_on == "yes") {
  115.  
  116. if(strstr($ban_ip_list, $HTTP_SERVER_VARS[REMOTE_ADDR])) {
  117. echo "<h2>DynaForm Error - Banned IP</h2>
  118. You cannot use this form because your IP address has been banned by the administ
    rator.<br>
  119. ";
  120. $error = "yes";
  121. }
  122. }
  123.  
  124.  
  125. if($error == "yes") {
  126. exit();
  127. }
  128.  
  129. // SET EMAIL INTRODUCTION
  130. $message = "Ten mail zostal wyslany ze strony www.moja_strona.com.pl\n\n\n\n";
  131.  
  132. // LOAD EMAIL CONTENTS 
  133. for ($i = 0; $i < count($incoming_fields); $i++) { 
  134. if($incoming_fields[$i] != "rec_mailto") {
  135. if($incoming_fields[$i] != "rec_subject") {
  136. if($incoming_fields[$i] != "rec_thanks") {
  137. if($incoming_fields[$i] != "opt_mailto_cc") {
  138. if($incoming_fields[$i] != "opt_mailto_bcc") {
  139.  
  140. // CHECK FOR REQUIRED FIELDS IF ACTIVATED
  141. if($required_on == "yes") {
  142. $sub = substr($incoming_fields[$i], 0, 2);
  143. if($sub == "r_") {
  144. if($incoming_values[$i] == "" OR !isset($incoming_values[$i]) OR $incoming_values[$i] == " ") {
  145. header("Location: $required_errorpage");
  146. exit();
  147. }}}
  148.  
  149. // ADD FIELD TO OUTGOING MESSAGE
  150. $message .= "$incoming_fields[$i]:\n$incoming_values[$i]\n\n";
  151. }}}}}}
  152.  
  153. // SET EMAIL FOOTER
  154. //$message .= "\n\nThank you for using our Webligo DynaForm script.\nWe ask that you pleas
    e link back to our site if you have not already.\nYour use of DynaForm is subject
     to the license agreement outlined in dynaform.php.\nVisit us at: http://www.webligo.com";
  155.  
  156. // CHECK FOR CC OR BCC
  157. $headers = "";
  158. if($incoming_mailto_cc != "") {
  159. $headers .= "Cc: $incoming_mailto_ccr\n";
  160. }
  161. if($incoming_mailto_bcc != "") {
  162. $headers .= "Bcc: $incoming_mailto_bccr\n";
  163. }
  164.  
  165. // SEND EMAIL
  166. mail($incoming_mailto, $incoming_subject, $message, $headers);
  167.  
  168. // SEND AUTO-RESPONSE IF ACTIVATED
  169. if($autorespond_on == "yes") {
  170. $autorespond_mailto = @$HTTP_POST_VARS[$autorespond_mailto_field];
  171. $autorespond_headers = "From: $autorespond_from";
  172. mail($autorespond_mailto, $autorespond_subject, $autorespond_contents, $autorespond_headers);
  173. }
  174.  
  175. // FORWARD TO THANK YOU PAGE
  176. header("Location: $incoming_thanks"); 
  177.  
  178.  
  179. ?>

prosze o pomoc jak zainicjować tu polskie czcionki

dzieki i pozdro
Gidzior
kod formularza:

  1. <form action="dynaform.php" method="POST">
  2. <input type='hidden' name='rec_mailto' value='adam.bartniak@gmail.com'>
  3. <input type='hidden' name='rec_subject' value='Zapytanie Ofertowe'>
  4. <input type='hidden' name='rec_thanks' value='dzieki.html'>
  5. <table width="100%" border="0">
  6. <tr>
  7. <th width="55%" scope="row"><div align="left" class="style5"><span class="style4"><span class="style5">Nazwa Firmy</span></span></div></th>
  8. <td width="45%"><div align="left"><span class="style4"><span class="style5">
  9. <input type="text" name="Nazwa Firmy" id="Nazwa Firmy">
  10. </span></span></div></td>
  11. </tr>
  12. <tr>
  13. <th scope="row"><div align="left" class="style5"><span class="style4"><span class="style5">Imię i Nazwisko</span></span></div></th>
  14. <td><div align="left"><span class="style4"><span class="style5">
  15. <input type="text" name="Imie Nazwisko" id="Imie Nazwisko">
  16. </span></span></div></td>
  17. </tr>
  18. <tr>
  19. <th scope="row"><div align="left" class="style5"><span class="style4"><span class="style5">Kod pocztowy</span></span></div></th>
  20. <td><div align="left"><span class="style4"><span class="style5">
  21. <input type="text" name="Kod pocztowy" id="Kod pocztowy">
  22. </span></span></div></td>
  23. </tr>
  24. <tr>
  25. <th scope="row"><div align="left" class="style5"><span class="style4"><span class="style5">Miejscowość</span></span></div></th>
  26. <td><div align="left"><span class="style4"><span class="style5">
  27. <input type="text" name="Miejscowosc" id="Miejscowosc">
  28. </span></span></div></td>
  29. </tr>
  30. <tr>
  31. <th scope="row"><div align="left" class="style5"><span class="style4"><span class="style5">Ulica, numer domu</span></span></div></th>
  32. <td><div align="left"><span class="style4"><span class="style5">
  33. <input type="text" name="Adres" id="Adres">
  34. </span></span></div></td>
  35. </tr>
  36. <tr>
  37. <th scope="row"><div align="left" class="style5"><span class="style4"><span class="style5">Numer kierunkowy</span></span></div></th>
  38. <td><div align="left"><span class="style4"><span class="style5">
  39. <input type="text" name="Numer kierunkowy" id="Numer kierunkowy">
  40. </span></span></div></td>
  41. </tr>
  42. <tr>
  43. <th scope="row"><div align="left" class="style5">
  44. </div>
  45. <span class="style4 style5">
  46. <label> </label>
  47. </span><span class="style4">
  48. </span> <label><div align="left" class="style5"><span class="style4">Telefon #1 </span></div>
  49. </label> </th>
  50. <td><div align="left"><span class="style4"><span class="style5">
  51. <input type="text" name="telefon1" id="telefon1">
  52. </span></span></div></td>
  53. </tr>
  54. <tr>
  55. <th scope="row"><div align="left" class="style5"><span class="style4"><span class="style5">Telefon #2</span></span></div></th>
  56. <td><div align="left"><span class="style4"><span class="style5">
  57. <input type="text" name="telefon2" id="telefon2">
  58. </span></span></div></td>
  59. </tr>
  60. <tr>
  61. <th scope="row"><div align="left" class="style5">
  62. </div>
  63. <span class="style4 style5">
  64. <label> </label>
  65. </span><span class="style4">
  66. </span> <label><div align="left" class="style5"><span class="style4">Faks </span></div>
  67. </label> </th>
  68. <td><div align="left"><span class="style4"><span class="style5">
  69. <input type="text" name="Faks" id="Faks">
  70. </span></span></div></td>
  71. </tr>
  72. <tr>
  73. <th scope="row"><div align="left" class="style5"><span class="style4"><span class="style5">E-mail</span></span></div></th>
  74. <td><div align="left"><span class="style4"><span class="style5">
  75. <input type="text" name="e-mail" id="e-mail">
  76. </span></span></div></td>
  77. </tr>
  78. <tr>
  79. <th scope="row"><div align="left" class="style5"><span class="style4"><span class="style5">Rodzaj działalności</span></span></div></th>
  80. <td><div align="left"><span class="style4"><span class="style5">
  81. <select name="dzialalnosc" id="dzialalnosc" size="1">
  82. <option>produkcja</option>
  83. <option>handel hurtowy</option>
  84. <option>handel detaliczny</option>
  85. <option>usługi</option>
  86. <option>import</option>
  87. <option>eksport</option>
  88. </select>
  89. </span></span></div></td>
  90. </tr>
  91. <tr>
  92. <th scope="row"><div align="left" class="style5"><span class="style4">Treść zapytania ofertowego</span></div></th>
  93. <td><div align="left"><span class="style4">
  94. <textarea name="zapytanie" cols="25" rows="5" wrap="physical" id="zapytanie"></textarea>
  95. </span></div></td>
  96. </tr>
  97. <tr>
  98. <th scope="row"> </th>
  99. <td><div align="right"><span class="style4">
  100. <br>
  101. <br>
  102. <input type="submit" value=" wyślij " >
  103. </span></div></td>
  104. </tr>
  105. </table>
  106. <p align="left" class="style4">
  107. <span class="style5">
  108. </span></p>
  109. </form>
Cysiaczek
Drogi gościu Gidzior. Zapraszam do rejestracji i pisania postów zgodnych z zasadami forum Przedszkole

Pozdrawiam.
l0ud
Gidzior, w jakim kodowaniu masz zrobioną swoją stronę?
Gidzior
charset=iso-8859-2

sory jesli zrobilem cos niezgodnie z zasadami forum
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.