mcnutdd Posted August 13, 2008 Posted August 13, 2008 I have figured out how to add more fields to my "Contact Us" form. The fields show up on my site and everything seems to be working well. I filled out all of the fields and clicked continue. Then I checked my e-mail to see if everything worked. To my disapointment, the only info that came across in the e-mail was the original fields (name, email, and enquiry). I assume there is a area that I am unaware of, a field that relates to the e-mailing of the "contact us" page. Please share any suggestions
oschellas Posted August 14, 2008 Posted August 14, 2008 You would have to edit the top of the contact_us.php file as well (like it does with the existing vars). Only adding input fields in the body is not enough.
mcnutdd Posted August 14, 2008 Author Posted August 14, 2008 I did edit the top but it may be wrong. I will try to post this page so that you may see if it is wrong. Here is the contact_us.php: <?php /* $Id: contact_us.php,v 1.42 2003/06/12 12:17:07 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ 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')) { $business_name = tep_db_prepare_input($HTTP_POST_VARS['business']); $name = tep_db_prepare_input($HTTP_POST_VARS['name']); $address = tep_db_prepare_input($HTTP_POST_VARS['address']); $city = tep_db_prepare_input($HTTP_POST_VARS['city']); $state = tep_db_prepare_input($HTTP_POST_VARS['state']); $zipcode = tep_db_prepare_input($HTTP_POST_VARS['zip']); $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']); $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']); $catalog = tep_db_prepare_input($HTTP_POST_VARS['catalog']); $find = tep_db_prepare_input($HTTP_POST_VARS['findus']); $Phone = tep_db_prepare_input($HTTP_POST_VARS['phone']); 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); } } $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=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="0" cellpadding="0" class="maincont_tb"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top" class="maincont_left_td"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0" class="leftbar_tb"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top" class="maincont_mid_td"> <?php require(DIR_WS_INCLUDES . 'sub_header.php'); ?> <?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 HEADING_TITLE; ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></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="center"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE, '0', '0', 'align="left"') . 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 { ?> <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 class="main"><?php echo BUSINESS_NAME; ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_input_field('business'); ?></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_ADDRESS; ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_input_field('address'); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_CITY; ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_input_field('city'); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_STATE; ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_input_field('state'); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_ZIP; ?></td> </tr> <tr> <td><?php echo tep_draw_textarea_field('zipcode','soft', 10, 1); ?></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> <tr> <td class="main"><?php echo ENTRY_ENQUIRY; ?></td> </tr> <tr> <td><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_CATALOG; ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_input_field('catalog'); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_FIND; ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_input_field('findus'); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_PHONE; ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_input_field('phone'); ?></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 width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right" class="main"><?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> <?php require(DIR_WS_INCLUDES . 'sub_footer.php'); ?> </td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top" class="maincont_right_td"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0" class="rightbar_tb"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </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'); ?>
lastblackjellybean Posted August 14, 2008 Posted August 14, 2008 if (tep_validate_email($email_address)) { tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address); You'll need to add in your new fields there.
oschellas Posted August 14, 2008 Posted August 14, 2008 Something like this: $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']); $business_name = tep_db_prepare_input($HTTP_POST_VARS['business']); $address = tep_db_prepare_input($HTTP_POST_VARS['address']); $city = tep_db_prepare_input($HTTP_POST_VARS['city']); $state = tep_db_prepare_input($HTTP_POST_VARS['state']); $zipcode = tep_db_prepare_input($HTTP_POST_VARS['zip']); $catalog = tep_db_prepare_input($HTTP_POST_VARS['catalog']); $find = tep_db_prepare_input($HTTP_POST_VARS['findus']); $phone = tep_db_prepare_input($HTTP_POST_VARS['phone']); $emailbody = ''; $emailbody .= "Business name : $business_name\n"; $emailbody .= "Address : $address\n"; $emailbody .= "City : $city\n"; $emailbody .= "State : $state\n"; $emailbody .= "Zipcode : $zipcode\n"; $emailbody .= "Catalog : $catalog\n"; $emailbody .= "Find : $find\n"; $emailbody .= "Phone : $phone\n"; $emailbody .= "Enquiry :\n $enquiry"; if (tep_validate_email($email_address)) { tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $emailbody, $name, $email_address);
Recommended Posts
Archived
This topic is now archived and is closed to further replies.