Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Contact form emails coming through in Chinese


lukebubb

Recommended Posts

Hi There,...

I am struggling to find what I am doing wrong here.. I have everything set up.. however whenever anyone goes to the contact page and uses the form, the emails come through to me in Chinese / Japanese.. I cant find for the life of me what I am doing wrong.. I will add the source code for the page.. If anyone could help I would be extremely grateful.. I am pretty disappointed because I paid a designer for a custom design to find they used a template, over charged me and cannot even rectify the issue.. Thank you

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2010 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US);

 

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {

$error = false;

 

$name = tep_db_prepare_input($HTTP_POST_VARS['name']);

$email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);

$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);

 

if (!tep_validate_email($email_address)) {

$error = true;

 

$messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);

}

 

$actionRecorder = new actionRecorder('ar_contact_us', (tep_session_is_registered('customer_id') ? $customer_id : null), $name);

if (!$actionRecorder->canPerform()) {

$error = true;

 

$actionRecorder->record(false);

 

$messageStack->add('contact', sprintf(ERROR_ACTION_RECORDER, (defined('MODULE_ACTION_RECORDER_CONTACT_US_EMAIL_MINUTES') ? (int)MODULE_ACTION_RECORDER_CONTACT_US_EMAIL_MINUTES : 15)));

}

 

if ($error == false) {

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);

 

$actionRecorder->record();

 

tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));

}

}

 

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));

 

require(DIR_WS_INCLUDES . 'template_top.php');

?>

 

<h1><?php echo HEADING_TITLE; ?></h1>

 

<?php

if ($messageStack->size('contact') > 0) {

echo $messageStack->output('contact');

}

 

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {

?>

 

<div class="contentContainer">

<div class="contentText">

<?php echo TEXT_SUCCESS; ?>

</div>

 

<div style="float: right;">

<?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?>

</div>

</div>

 

<?php

} else {

?>

 

<?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_CONTACT_US, 'action=send'), 'post', '', true); ?>

 

<div class="contentContainer">

<div class="contentText">

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="fieldKey"><?php echo ENTRY_NAME; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('name'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_EMAIL; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('email'); ?></td>

</tr>

<tr>

<td class="fieldKey" valign="top"><?php echo ENTRY_ENQUIRY; ?></td>

<td class="fieldValue"><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15); ?></td>

</tr>

</table>

</div>

 

<div class="buttonSet">

<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', null, 'primary'); ?></span>

</div>

</div>

 

</form>

 

<?php

}

 

require(DIR_WS_INCLUDES . 'template_bottom.php');

require(DIR_WS_INCLUDES . 'application_bottom.php');

?>

Link to comment
Share on other sites

Hi Luke,

 

Nothing wrong there it is a standard contact page what does your /includes/languages/english/contact_us.php look like ??

 

Regards

Joli

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

Hey Joli.. Thanks for your response.. I have gone into the above contact_us.php settings, and it looks like this..

 

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

 

define('HEADING_TITLE', 'Contact Us');

define('NAVBAR_TITLE', 'Contact Us');

define('TEXT_SUCCESS', 'Your enquiry has been successfully sent to the Store Owner.');

define('EMAIL_SUBJECT', 'Enquiry from ' . STORE_NAME);

 

define('ENTRY_NAME', 'Full Name:');

define('ENTRY_EMAIL', 'E-Mail Address:');

define('ENTRY_ENQUIRY', 'Enquiry:');

 

define('ERROR_ACTION_RECORDER', 'Error: An enquiry has already been sent. Please try again in %s minutes.');

?>

Link to comment
Share on other sites

@@lukebubb Are you saying parts of the email not entered by the person using the form is in another language or the text of the email. If the latter, perhaps that is correct. Have you tried using the form yourself? What languages do you have installed (see admin->Localization->:Languages)? What is the default language?

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Does the "Chinese" text actually make sense (when fed through Google Translate), or is it random garbage? What is your database, language, and page encoding? If this is osC 2.3.x, it ought to be UTF-8, but there's no telling what your contractor did to it. When you get the "Chinese" email, is it just the customer-entered text that's not English, or are any parts expected to be English also in Chinese? You've confirmed that this isn't simply Chinese-language spam being sent through the contact form?

Link to comment
Share on other sites

@@MrPhil

@@Jacks_mcsl

 

Sorry for delay im a bit of a noob at all this..

 

okay.. So in the emails the Header is in english, the sender name is in english.. the body in is chinese..

also in regards to whether the chinese makes sense or random garbage, is certrainly looking random garbage when i translate.

I have tried this myself and gone to the page typed in details and sent through and it did still come through chinese.

when I goto admin there is no localisation folder there so I cant check the languages installed as suggested .

however when i goto admin/includes/ there is a localisation folder and it has a english.php file and an english folder

Where should i look to find the database and page encoding?

 

also under admin/includes/languages/english I have looked at the languages.php and this is what is there..

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

 

define('HEADING_TITLE', 'Languages');

 

define('TABLE_HEADING_LANGUAGE_NAME', 'Language');

define('TABLE_HEADING_LANGUAGE_CODE', 'Code');

define('TABLE_HEADING_ACTION', 'Action');

 

define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');

define('TEXT_INFO_LANGUAGE_NAME', 'Name:');

define('TEXT_INFO_LANGUAGE_CODE', 'Code:');

define('TEXT_INFO_LANGUAGE_IMAGE', 'Image:');

define('TEXT_INFO_LANGUAGE_DIRECTORY', 'Directory:');

define('TEXT_INFO_LANGUAGE_SORT_ORDER', 'Sort Order:');

define('TEXT_INFO_INSERT_INTRO', 'Please enter the new language with its related data');

define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this language?');

define('TEXT_INFO_HEADING_NEW_LANGUAGE', 'New Language');

define('TEXT_INFO_HEADING_EDIT_LANGUAGE', 'Edit Language');

define('TEXT_INFO_HEADING_DELETE_LANGUAGE', 'Delete Language');

 

define('ERROR_REMOVE_DEFAULT_LANGUAGE', 'Error: The default language can not be removed. Please set another language as default, and try again.');

?>

Link to comment
Share on other sites

is certrainly looking random garbage when i translate

So you've confirmed that these are NOT Chinese spammers using your contact form to spam you? You've tried other similar looking languages such as Japanese or Korean, or let the translator try to figure it out what the language is? There are many other non-Latin alphabets, but presumably you can recognize this as East Asian.

 

Where should i look to find the database and page encoding?

Database: phpMyAdmin

Page: in your browser, View > Character Set (or something similar)

 

I have looked at the languages.php

Your language files are what non-English languages (French, Chinese, etc.) you have installed. What we're interested in is whether the language file is setting its own encoding (overriding the database encoding).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...