edmondwch Posted May 26, 2009 Share Posted May 26, 2009 Dear All, When customer using the contact us form to send me enquiry, what I receive is only the content of the enquiry, but there is no customer's name and email address --- so HOW CAN I REPLY HIM?! I don't know what's wrong, below I post my contact_us.php script, please help figure out my problem, million thx! <?php require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US); $error = false; if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) { $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)) { // tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address); // tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success')); // } else { // $error = true; // $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); // } //VISUAL VERIFY CODE start if (tep_validate_email($email_address) == false) { $error = true; $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } require(DIR_WS_FUNCTIONS . 'visual_verify_code.php'); $code_query = tep_db_query("select code from visual_verify_code where oscsid = '" . $HTTP_GET_VARS['osCsid'] . "'"); $code_array = tep_db_fetch_array($code_query); $code = $code_array['code']; tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'"); //remove the visual verify code associated with this session to clean database and ensure new results $user_entered_code = $HTTP_POST_VARS['visual_verify_code']; if (!(strcasecmp($user_entered_code, $code) == 0)) { //make the check case insensitive $error = true; $messageStack->add('contact', VISUAL_VERIFY_CODE_ENTRY_ERROR); } if ($error == false) { tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT. ' ' . $subject, $enquiry, $name, $email_address); // start send_copy_to_customer_ $subject = tep_db_prepare_input($HTTP_POST_VARS['subject']); $email_text .= EMAIL_HEAD_PIC . ENQUIRY_FEEDBACK . ENQUIRY_COPY_SUB . $subject . ENQUIRY_COPY_CON . $enquiry . ENQUIRY_EMAIL_WARNING . EMAIL_FOOT_PIC; if ($send_copy_customer == true) { tep_mail($name, $email_address, EXTRA_SUBJECT_CUSTOMER, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } // end send_copy_to_customer tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success')); } //VISUAL VERIFY CODE stop } $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US)); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="<?php echo DIR_WS_LANGUAGES . $language . '/'; ?>stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <table cellpadding="0" cellspacing="0" border="0" width="830" align="center"><tr><td style="background:url(images/bg.gif) left top repeat-x;"> <table cellpadding="0" cellspacing="0" border="0" align="center"> <tr><td> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_CONTACT_US, 'action=send')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo tep_image_button('image-contact.gif',IMAGE_BUTTON_CONTACT) . '</a>'; ?><?php //echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php //echo tep_image(DIR_WS_IMAGES . 'table_background_contact_us.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <?php if ($messageStack->size('contact') > 0) { ?> <tr> <td><?php echo $messageStack->output('contact'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) { ?> <tr> <td class="main" align="left"><?php echo TEXT_SUCCESS; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } else { ?> <!-- start send_copy_to_customer --> <!-- end send_copy_to_customer --> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <tr> <td class="main"><?php echo sprintf(CONTACT_REMIND, tep_href_link(FILENAME_FAQ, tep_get_all_get_params())); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_NAME; ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_input_field('name'); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_EMAIL; ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_input_field('email'); ?></td> </tr> <!-- start send_copy_to_customer --> <tr> <td class="main"><?php echo ENTRY_SUBJECT; ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_input_field('subject'); ?></td> </tr> <!-- end send_copy_to_customer --> <tr> <td class="main"><?php echo ENTRY_ENQUIRY; ?></td> </tr> <tr> <td><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 10); ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_checkbox_field('send_copy_customer', '1', false) . ' ' . (tep_not_null(TEXT_COPY_CUSTOMER) ? '<span class="main">' . TEXT_COPY_CUSTOMER . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo VISUAL_VERIFY_CODE_CATEGORY; ?></td> </tr> <tr> <td class="main"><table width="100%" border="0" cellpadding="3"> <tr> <td bgcolor="EBEADF"><table border="0" cellspacing="2" cellpadding="2"> <tr> <td class="main"><?php //can replace the following loop with $visual_verify_code = substr(str_shuffle (VISUAL_VERIFY_CODE_CHARACTER_POOL), 0, rand(3,6)); if you have PHP 4.3 $visual_verify_code = ""; for ($i = 1; $i <= rand(3,6); $i++){ $visual_verify_code = $visual_verify_code . substr(VISUAL_VERIFY_CODE_CHARACTER_POOL, rand(0, strlen(VISUAL_VERIFY_CODE_CHARACTER_POOL)-1), 1); } $vvcode_oscsid = $HTTP_GET_VARS['osCsid']; tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'"); $sql_data_array = array('oscsid' => $vvcode_oscsid, 'code' => $visual_verify_code); tep_db_perform(TABLE_VISUAL_VERIFY_CODE, $sql_data_array); $visual_verify_code = ""; echo('<img src="' . FILENAME_VISUAL_VERIFY_CODE_DISPLAY . '?vvc=' . $vvcode_oscsid . '"'); ?></td> <td class="main"><?php echo VISUAL_VERIFY_CODE_TEXT_INSTRUCTIONS; ?></td> <td class="main"><?php echo tep_draw_input_field('visual_verify_code'); ?></td> <td class="main"> </td> </tr> <tr> <td colspan="4" class="note"><?php echo VERIFY_REMINDER; ?></td> </tr> </table> </td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } ?> </table> </form></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Link to comment Share on other sites More sharing options...
germ Posted May 26, 2009 Share Posted May 26, 2009 Link to a "workaround" If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
edmondwch Posted May 27, 2009 Author Share Posted May 27, 2009 Hi Germ, Thank you, my problem is solved! Thank you for your great assistance!!! best regards, edmond Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.