Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php][html]polskie znaki w formularzu
-Gidzior-
post
Post #1





Goście







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
Powód edycji: dodalem tagi (cysiaczek)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
-Gidzior-
post
Post #2





Goście







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
Powód edycji: dodałem bbcode (cysiaczek)
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 3.10.2025 - 13:46