Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2007
    Posts
    375
    Plugin Contributions
    3

    Default How do I change the "Contact Us" Form encoding to UTF-8?

    Hi all,

    Since my cart now discovered that some customers from other country that using non-english to input text on the "Contact Us" page.

    What the e-mail that we received are changed to #454342; etc.

    How to force only "Contact US" are using UTF-8 to send the e-mail out.

    I know can change the html_header.php under common, but it will also make the whole web site be UTF-8 that what I don't want to, since the MySQL Database and other products that entered are using ISO-8859-1 for encoder....

    and I open
    \includes\templates\template_default\templates\tpl_contact_us_default.php

    Find this line
    <div class="centerColumn" id="contactUsDefault">

    <?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')) . 'accept-charset="UTF-8"'; ?>

    It will output the HTML code on the front-end like below

    <div class="centerColumn" id="contactUsDefault">

    <form name="contact_us" action="http://www.rctoplist.com/testegrm/contact_us.html?action=send" method="post">

    Then I try to change it by this below:

    <div class="centerColumn" id="contactUsDefault">

    <?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')) . 'accept-charset="UTF-8"'; ?>

    But it will show the HTML code on the front-end like that not what I want ...

    <div class="centerColumn" id="contactUsDefault">

    <form name="contact_us" action="http://www.rctoplist.com/testegrm/contact_us.html?action=send" method="post">accept-charset="UTF-8"
    Like what you see, the accept-charset="UTF-8" is not in the method="post"> or behind it

    How to make the PHP code to output the HTML be that right one?


    <div class="centerColumn" id="contactUsDefault">

    <form name="contact_us" action="http://www.rctoplist.com/testegrm/contact_us.html?action=send" method="post"
    accept-charset="UTF-8"
    >


    Thank you very much.

  2. #2
    Join Date
    Jan 2007
    Posts
    375
    Plugin Contributions
    3

    red flag Need help to add some PHP code of the "Contact Us"

    Hi all,

    I had a big problems while my customers using the "Contact Us" form to send the questions to us.

    Since Zen Cart 1.3.7 are encode by ISO 8859-1, not using UTF-8 and the MySQL Database Collection are using latin_swfish_1, also not UTF-8

    So change the header to UTF-8 total maybe will broke the all site.

    So now I reading the "Contact Us"'s PHP code, find it control by this file
    /includes/templates/template_default/templates/tpl_contact_us_default.php

    and I find by Google, have a tag called accept-charset="UTF-8" for the form tag ...

    So I want to make a try, but I am not a programmer, try add this tag to the original PHP code failed

    The Original Code here
    <?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')); ?>

    and it will display this XHTML output

    <form name="contact_us" action="http://www.rctoplist.com/testegrm/contact_us.html?action=send" method="post">

    How to make the change to the PHP code that can add the accept-charset="UTF-8", then the XHTML output to be like that

    <form name="contact_us" action="http://www.rctoplist.com/testegrm/contact_us.html?action=send" method="post" accept-charset="UTF-8">

    Thank you very much.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: How do I change the "Contact Us" Form encoding to UTF-8?

    Quote Originally Posted by explorer1979 View Post
    <?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')) . 'accept-charset="UTF-8"'; ?>
    You've put the extra parameter in the wrong place.

    Try this instead:
    Code:
    <?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send'), 'post', 'accept-charset="UTF-8"'); ?>
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Jan 2007
    Posts
    375
    Plugin Contributions
    3

    Default Re: How do I change the "Contact Us" Form encoding to UTF-8?

    I following your code add to it, it show me that@@



    Error!

    Unable to determine connection method on a link!

    Known methods: NONSSL SSL



  5. #5
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: How do I change the "Contact Us" Form encoding to UTF-8?

    Try:
    <?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send'), 'post', 'accept-charset="UTF-8"'); ?>
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  6. #6
    Join Date
    Jan 2007
    Posts
    375
    Plugin Contributions
    3

    Default Re: How do I change the "Contact Us" Form encoding to UTF-8?

    The code need be that

    PHP Code:
    <?php echo zen_draw_form('contact_us'zen_href_link(FILENAME_CONTACT_US'action=send') , 'post''accept-charset="UTF-8"'
    ); ?>

  7. #7
    Join Date
    Jan 2007
    Posts
    375
    Plugin Contributions
    3

    Default Re: How do I change the "Contact Us" Form encoding to UTF-8?

    This way not work

    Can send the e-mail

    But received e-mail content like that (Based on header meta using ISO-8859-1, but if change the header meta to UTF-8, the MySQL using latin1- collection will don't know what happened! it is why I not change the header meta from ISO-8859-1 to UTF-8, just thinking the form tag or by the other side...)

    ##–‡ (Chinese)

    現役ˆ ‚ƒƒ—東‡Œ—大ˆ (Japanese)

    現役ˆ ‚ƒƒ—東‡Œ—大ˆ (Koren)



    Before not change anything and the e-mail will send back like that (Header meta using ISO-8859-1 too)

    Chinese
    中文字


    Anyone have experience the "Contact Us" received E-Mail that is not using English like, Japanese or etc, what is your solved on this?

  8. #8
    Join Date
    Jan 2007
    Posts
    375
    Plugin Contributions
    3

    Default Re: How do I change the "Contact Us" Form encoding to UTF-8?

    Hi, after I try this way

    Add the code to it
    <?php
    header('content-type: text/html; charset: utf-8');
    ?>

    Then the front-page show this

    Warning: Cannot modify header information - headers already sent by (output started at /home/hpcd/public_html/hpcd/includes/templates/ZC03C00093/common/html_header.php:22) in /home/hpcd/public_html/hpcd/includes/templates/template_default/templates/tpl_contact_us_default.php on line 16



    I know the header is loaded first, but do it have a way to force add a coding like that to replaced loaded header's content from ISO-8859-1 to UTF-8?

    Thank

  9. #9
    Join Date
    Jan 2007
    Posts
    375
    Plugin Contributions
    3

    Default Re: How do I change the "Contact Us" Form encoding to UTF-8?

    For example

    The
    define('CHARSET','iso-8859-1');

    How to re define the
    CHARSET to utf-8 after it loaded the value.

 

 

Similar Threads

  1. How to duplicate the "Contact Us" form?
    By brokenbird in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 15 Sep 2011, 01:30 PM
  2. How do I change "Contact Us : Zen Cart!" to the title of my store
    By maronesty in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 28 Aug 2011, 04:51 AM
  3. How do I change the "Contact Us" re-direct?
    By jahan in forum General Questions
    Replies: 3
    Last Post: 27 Jul 2010, 03:13 AM
  4. how to move "contact us", "about us" etc to the bottom of page?
    By zc-newbie in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 10 Jul 2007, 07:20 AM
  5. I want to change the Wording "Contact Us" to "Contact Me"
    By Arcade:Alchemy in forum Basic Configuration
    Replies: 3
    Last Post: 9 Mar 2007, 07:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg