bfadler Posted September 25, 2007 Share Posted September 25, 2007 I copied the contact_us page,renamed it, and added some fields which I want added to an email. The input fields show on the site but the user inputted text doesn't get added to the email, just the comment text gets added. Its basically going to be an application for employment when done but I'm just trying to get it to work with the four added questions. no links on the site to get here www.specialistscaraudio.com/employment.php I know it has to do with this code but can't get it to work: 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, $question_1, $question_2, $question_3, $question_4); tep_redirect(tep_href_link(FILENAME_EMPLOYMENT, 'action=success')); } else { $error = true; Here is the table that the fields are in: <table border="0" width="402" cellspacing="0" cellpadding="2"> <tr> <td colspan="2" class="main"><div align="left"></div></td> </tr> <tr> <td height="1" colspan="2" class="infoBox"></td> </tr> <tr align="center"> <td colspan="2" class="main"><strong>Please Answer Every Question</strong></td> </tr> <tr> <td align="left" class="main"><?php echo ENTRY_NAME; ?></td> <td align="right" class="main"><?php echo ENTRY_EMAIL; ?></td> </tr> <tr> <td align="left" class="main"><?php echo tep_draw_input_field('name'); ?></td> <td align="right" class="main"><?php echo tep_draw_input_field('email'); ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo ENTRY_QUESTION_01; ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo tep_draw_textarea_field('question_1','soft', 25, 1); ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo ENTRY_QUESTION_02; ?></td> </tr> <tr><td colspan="2" class="main"><?php echo tep_draw_textarea_field('question_2','soft', 25, 1); ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo ENTRY_QUESTION_03; ?></td> </tr> <tr><td colspan="2" class="main"><?php echo tep_draw_textarea_field('question_3','soft', 25, 1); ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo ENTRY_QUESTION_04; ?></td> </tr> <tr><td colspan="2" class="main"><?php echo tep_draw_textarea_field('question_4','soft', 25, 1); ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo ENTRY_COMMENTS; ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_textarea_field('enquiry', 'soft', 25, 5); ?></td> </tr> </table> Quote Link to comment https://forums.phpfreaks.com/topic/70679-solved-user-inputted-text-wont-show-in-email/ Share on other sites More sharing options...
suttercain Posted September 25, 2007 Share Posted September 25, 2007 The functions tep_mail() and tep_redirect() are not defined in your code. Is there more code on your PHP page that you did not include here? SC Quote Link to comment https://forums.phpfreaks.com/topic/70679-solved-user-inputted-text-wont-show-in-email/#findComment-355284 Share on other sites More sharing options...
bfadler Posted September 25, 2007 Author Share Posted September 25, 2007 Yes I did not include everything, here it is: <?php /* $Id: employment.php,v 1.42 2003/06/12 12:17:07 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_EMPLOYMENT); $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']); $question_1 = tep_db_prepare_input($HTTP_POST_VARS['question_1']); $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, $question_1, $question_2, $question_3, $question_4); tep_redirect(tep_href_link(FILENAME_EMPLOYMENT, 'action=success')); } else { $error = true; $messageStack->add('employment', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } } $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_EMPLOYMENT)); ?> <!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="stylesheet31.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 //--> <!-- Start Code --> <tr><td valign="top" height="304"> <table width="1000" border="0" cellpadding="0" cellspacing="0"> <tr><td width="5"></td> <td valign="top"><?php require(DIR_WS_INCLUDES . 'column_left.php'); ?></td> <td width="10"></td> <td width="435" valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td width="" height="22"> <span class="tx2"><?=HEADING_TITLE?></span></td> </tr> <tr><td height="1" bgcolor="#6B737A"></td> </tr> <tr><td width="" height="20"> <span class="tx2">We are always looking for sales associates and installers </span></td> </tr> </table> <?php echo tep_draw_form('employment', tep_href_link(FILENAME_EMPLOYMENT, 'action=send')); ?> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <?php if ($messageStack->size('employment') > 0) { ?> <tr> <td><?php echo $messageStack->output('employment'); ?></td> </tr> <tr> <td class="main"><?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 . '', 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"> <tr> <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="402" cellspacing="0" cellpadding="2"> <tr> <td colspan="2" class="main"><div align="left"></div></td> </tr> <tr> <td height="1" colspan="2" class="infoBox"></td> </tr> <tr align="center"> <td colspan="2" class="main"><strong><u>Please Answer Every Question</u></strong></td> </tr> <tr> <td align="left" class="main"><?php echo ENTRY_NAME; ?></td> <td align="right" class="main"><?php echo ENTRY_EMAIL; ?></td> </tr> <tr> <td align="left" class="main"><?php echo tep_draw_input_field('name'); ?></td> <td align="right" class="main"><?php echo tep_draw_input_field('email'); ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo ENTRY_QUESTION_01; ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo tep_draw_textarea_field('question_1','soft', 25, 1); ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo ENTRY_QUESTION_02; ?></td> </tr> <tr><td colspan="2" class="main"><?php echo tep_draw_textarea_field('question_2','soft', 25, 1); ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo ENTRY_QUESTION_03; ?></td> </tr> <tr><td colspan="2" class="main"><?php echo tep_draw_textarea_field('question_3','soft', 25, 1); ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo ENTRY_QUESTION_04; ?></td> </tr> <tr><td colspan="2" class="main"><?php echo tep_draw_textarea_field('question_4','soft', 25, 1); ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo ENTRY_COMMENTS; ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_textarea_field('enquiry', 'soft', 25, 5); ?></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"> <tr> <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 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> </td> <td></td> <td width="10"> </td> <td align="left" valign="top"><?php require(DIR_WS_INCLUDES . 'column_right.php'); ?></td> <td width="5" align="right" valign="top"> </td> </tr> </table> </td></tr> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/70679-solved-user-inputted-text-wont-show-in-email/#findComment-355288 Share on other sites More sharing options...
suttercain Posted September 25, 2007 Share Posted September 25, 2007 Where are the user defined functions being defined? tep_validate_email() That is not a php function. There needs to be somewhere it is defined function tep_validate_email() { //do stuff } Quote Link to comment https://forums.phpfreaks.com/topic/70679-solved-user-inputted-text-wont-show-in-email/#findComment-355291 Share on other sites More sharing options...
bfadler Posted September 25, 2007 Author Share Posted September 25, 2007 I am not very well versed in php i figured plenty out but still lacking I hope this is what you mean they are in this table starting with <?php echo tep_draw_input_field('name'); ?> <table border="0" width="402" cellspacing="0" cellpadding="2"> <tr> <td colspan="2" class="main"><div align="left"></div></td> </tr> <tr> <td height="1" colspan="2" class="infoBox"></td> </tr> <tr align="center"> <td colspan="2" class="main"><strong>Please Answer Every Question</strong></td> </tr> <tr> <td align="left" class="main"><?php echo ENTRY_NAME; ?></td> <td align="right" class="main"><?php echo ENTRY_EMAIL; ?></td> </tr> <tr> <td align="left" class="main"><?php echo tep_draw_input_field('name'); ?></td> <----Right Here <td align="right" class="main"><?php echo tep_draw_input_field('email'); ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo ENTRY_QUESTION_01; ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo tep_draw_textarea_field('question_1','soft', 25, 1); ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo ENTRY_QUESTION_02; ?></td> </tr> <tr><td colspan="2" class="main"><?php echo tep_draw_textarea_field('question_2','soft', 25, 1); ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo ENTRY_QUESTION_03; ?></td> </tr> <tr><td colspan="2" class="main"><?php echo tep_draw_textarea_field('question_3','soft', 25, 1); ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo ENTRY_QUESTION_04; ?></td> </tr> <tr><td colspan="2" class="main"><?php echo tep_draw_textarea_field('question_4','soft', 25, 1); ?></td> </tr> <tr> <td colspan="2" class="main"><?php echo ENTRY_COMMENTS; ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_textarea_field('enquiry', 'soft', 25, 5); ?></td> </tr> </table> As for the tep_validate_email function im not sure but if the text box is left blank it throws an email is invalid error Quote Link to comment https://forums.phpfreaks.com/topic/70679-solved-user-inputted-text-wont-show-in-email/#findComment-355327 Share on other sites More sharing options...
bfadler Posted September 25, 2007 Author Share Posted September 25, 2007 I found the file where the tep_validate_email() is defined. So it is defined just not in the employment.php file. Quote Link to comment https://forums.phpfreaks.com/topic/70679-solved-user-inputted-text-wont-show-in-email/#findComment-355334 Share on other sites More sharing options...
suttercain Posted September 27, 2007 Share Posted September 27, 2007 The function must be defined in the same file or as an include into that file. Quote Link to comment https://forums.phpfreaks.com/topic/70679-solved-user-inputted-text-wont-show-in-email/#findComment-356435 Share on other sites More sharing options...
bfadler Posted October 1, 2007 Author Share Posted October 1, 2007 The email function is defined in another file (validation.php) and it works. Thats not the issue I'm having though, I added four questions to the contact page, copied and renamed it to employment.php, I also edited includes\languages\english\contact.php and copied and renamed it to employment.php. The first employment.php calls from the second to fill in the users name, email, and comment boxes as well as the added questions. This part works as you can see here http://www.specialistscaraudio.com/employment.php The issue is when someone puts info into the boxes for the added questions they do not get added to the email when the person hits continue. Only the Name, Email, and Comments get added, like it was still the contact page, is there another file I'm not finding that needs to be edited. Quote Link to comment https://forums.phpfreaks.com/topic/70679-solved-user-inputted-text-wont-show-in-email/#findComment-359509 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.