Jump to content

[SOLVED] User inputted text wont show in Email


Recommended Posts

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>

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'); ?>

 

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

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.

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.