Zen Cart Logo
Forums / Basic Configuration / Adding radio/checkbox fields to Contact Us Form and receiving them in e-mail properly

Adding radio/checkbox fields to Contact Us Form and receiving them in e-mail properly

Locked

Views: 4,814

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
21 Jan 2010, 6:12 PM
#1
salixia avatar

salixia

New Zenner

Join Date:
Oct 2009
Posts:
30
Plugin Contributions:
0

Adding radio/checkbox fields to Contact Us Form and receiving them in e-mail properly

Hello,

I have successfully added the fields I want to my Contact Us Form, and am now editing the header_php.php file so I receive the collected new field data in the e-mail sent.

The problem is the new fields are actually radio and checkbox type.
I have gotten my php to send the collected field information, but it is not very clean.

This is what I get in the e-mail:

Urgent: id="urgent"
Topic: value="Praise"
Subject: value="Employee"

I want to remove the value="" and id="" and just have

Urgent: Yes or No depending on if it was checked
Topic: Praise
Subject: Employee

Here is the edited code from the actually form tpl_contact_us_default.php:

<h3>What kind of comment would you like to send?</h3>

<label for="topic"><?php echo ENTRY_TOPIC; ?></label>
<?php echo zen_draw_radio_field('topic', ' value="Question"') . Question . '    ';
echo zen_draw_radio_field('topic', ' value="Complaint"') . Complaint . '    ';
echo zen_draw_radio_field('topic', ' value="Problem"') . Problem . '    ';
echo zen_draw_radio_field('topic', ' value="Suggestion"') . Suggestion . '    ';
echo zen_draw_radio_field('topic', ' value="Praise"') . Praise; ?>
<br />




<h3>What about us do you want to comment on?</h3>

<label for="subject"><?php echo ENTRY_SUBJECT; ?></label>
<?php echo zen_draw_radio_field('subject', 'value="Website"') . Website . '    ';
echo zen_draw_radio_field('subject', ' value="Company"') . Company . '    ';
echo zen_draw_radio_field('subject', ' value="Products"') . Products . '    ';
echo zen_draw_radio_field('subject', ' value="Store"') . Store . '    ';
echo zen_draw_radio_field('subject', ' value="Employee"') . Employee . '    ';
echo zen_draw_radio_field('subject', ' value="Order"') . Order . '    ';
echo zen_draw_radio_field('subject', ' value="Other"') . Other; ?>
<br class="clearBoth" />

<label for="urgent"><?php echo ENTRY_URGENT; ?></label>
<?php echo zen_draw_checkbox_field('urgent', ' id="urgent"') . "Please contact me as soon as possible regarding this matter"; ?><br />

Here is my code from header_php.php:

$urgent = zen_db_prepare_input($_POST['urgent']);
$topic = zen_db_prepare_input($_POST['topic']);
$selected_radio = $_POST['subject'];

OFFICE_URGENT . "\t" . $_POST['urgent'] . "\n" .
OFFICE_TOPIC . "\t" . $_POST['topic'] . "\n" .
OFFICE_SUBJECT . "\t" . $selected_radio = $_POST['subject'] . "\n\n" .

Thanks for the help.

21 Jan 2010, 8:16 PM
#2
salixia avatar

salixia

New Zenner

Join Date:
Oct 2009
Posts:
30
Plugin Contributions:
0

Re: Adding radio/checkbox fields to Contact Us Form and receiving them in e-mail properly

the contact_us.php and email_extras.php are not bugging it.

It has to be header_php.php or tpl_contact_us_default.php

My code for header_php.php

<?php
/**
 * Contact Us Page
 *
 * @package page
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header_php.php 6202 2007-04-12 22:56:10Z drbyte $
 */
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));

$error = false;
if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
  $name = zen_db_prepare_input($_POST['contactname']);
  $email_address = zen_db_prepare_input($_POST['email']);

added this section:

$zipcode = zen_db_prepare_input($_POST['zipcode']);
  $phone = zen_db_prepare_input($_POST['phone']);
  $fax = zen_db_prepare_input($_POST['fax']);
  $urgent = zen_db_prepare_input($_POST['urgent']);
  $topic = zen_db_prepare_input($_POST['topic']);
  $subject = zen_db_prepare_input($_POST['subject']);
  $selected_radio = $_POST['subject'];

return to original code:

$enquiry = zen_db_prepare_input(strip_tags($_POST['enquiry']));

  $zc_validate_email = zen_validate_email($email_address);

  if ($zc_validate_email and !empty($enquiry) and !empty($name)) {
    // auto complete when logged in
    if($_SESSION['customer_id']) {
      $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id 
              FROM " . TABLE_CUSTOMERS . " 
              WHERE customers_id = :customersID";
      
      $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
      $check_customer = $db->Execute($sql);
      $customer_email= $check_customer->fields['customers_email_address'];
      $customer_name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
    } else {
      $customer_email = NOT_LOGGED_IN_TEXT;
      $customer_name = NOT_LOGGED_IN_TEXT;
    }

    // use contact us dropdown if defined
    if (CONTACT_US_LIST !=''){
      $send_to_array=explode("," ,CONTACT_US_LIST);
      preg_match('/\<[^>]+\>/', $send_to_array[$_POST['send_to']], $send_email_array);
      $send_to_email= eregi_replace (">", "", $send_email_array[0]);
      $send_to_email= eregi_replace ("<", "", $send_to_email);
      $send_to_name = preg_replace('/\<[^*]*/', '', $send_to_array[$_POST['send_to']]);
    } else {  //otherwise default to EMAIL_FROM and store name
    $send_to_email = EMAIL_FROM;
    $send_to_name =  STORE_NAME;
    }

    // Prepare extra-info details
    $extra_info = email_collect_extra_info($name, $email_address, $customer_name, $customer_email);
    // Prepare Text-only portion of message
    $text_message = OFFICE_FROM . "\t" . $name . "\n" .
    OFFICE_EMAIL . "\t" . $email_address . "\n" .

changed code again:

OFFICE_ZIPCODE . "\t" . $zipcode . "\n" .
	OFFICE_PHONE . "\t" . $phone . "\n" .
	OFFICE_FAX . "\t" . $fax . "\n\n" .
    '------------------------------------------------------' . "\n\n" .
    OFFICE_URGENT . "\t" . $_POST['urgent'] . "\n" .
	OFFICE_TOPIC . "\t" . $_POST['topic'] . "\n" .
	OFFICE_SUBJECT . "\t" . $_POST['subject'] . "\n\n" .
	strip_tags($_POST['enquiry']) .  "\n\n" .
    '------------------------------------------------------' . "\n\n" .

rest of unedited code:

$extra_info['TEXT'];
    // Prepare HTML-portion of message
    $html_msg['EMAIL_MESSAGE_HTML'] = strip_tags($_POST['enquiry']);
    $html_msg['CONTACT_US_OFFICE_FROM'] = OFFICE_FROM . ' ' . $name . '<br />' . OFFICE_EMAIL . '(' . $email_address . ')';
    $html_msg['EXTRA_INFO'] = $extra_info['HTML'];
    // Send message
    zen_mail($send_to_name, $send_to_email, EMAIL_SUBJECT, $text_message, $name, $email_address, $html_msg,'contact_us');

    zen_redirect(zen_href_link(FILENAME_CONTACT_US, 'action=success'));
  } else {
    $error = true;
    if (empty($name)) {
      $messageStack->add('contact', ENTRY_EMAIL_NAME_CHECK_ERROR);
    }
    if ($zc_validate_email == false) {
      $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
    }
    if (empty($enquiry)) {
      $messageStack->add('contact', ENTRY_EMAIL_CONTENT_CHECK_ERROR);
    }
  }
} // end action==send

// default email and name if customer is logged in
if($_SESSION['customer_id']) {
  $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id 
          FROM " . TABLE_CUSTOMERS . " 
          WHERE customers_id = :customersID";
  
  $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
  $check_customer = $db->Execute($sql);
  $email= $check_customer->fields['customers_email_address'];
  $name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
}

if (CONTACT_US_LIST !=''){
  foreach(explode(",", CONTACT_US_LIST) as $k => $v) {
    $send_to_array[] = array('id' => $k, 'text' => preg_replace('/\<[^*]*/', '', $v));
  }
}

// include template specific file name defines
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_CONTACT_US, 'false');

$breadcrumb->add(NAVBAR_TITLE);
?>

My code for tpl_contact_us_default.php

Original start of code didnt touch this part

<?php
/**
 * Page Template
 *
 * Loaded automatically by index.php?main_page=contact_us.<br />
 * Displays contact us page form.
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_contact_us_default.php 4272 2006-08-26 03:10:49Z drbyte $
 */
?>
<div class="centerColumn" id="contactUsDefault">

<?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')); ?>

<?php if (CONTACT_US_STORE_NAME_ADDRESS== '1') { ?>
<address><?php echo nl2br(STORE_NAME_ADDRESS); ?></address>
<?php } ?>

<?php
  if (isset($_GET['action']) && ($_GET['action'] == 'success')) {
?>

<div class="mainContent success"><?php echo TEXT_SUCCESS; ?></div>

<div class="buttonRow"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>

<?php
  } else {
?>

<?php if (DEFINE_CONTACT_US_STATUS >= '1' and DEFINE_CONTACT_US_STATUS <= '2') { ?>
<div id="contactUsNoticeContent" class="content">
<?php
/**
 * require html_define for the contact_us page
 */
  require($define_page);
?>
</div>
<?php } ?>

<?php if ($messageStack->size('contact') > 0) echo $messageStack->output('contact'); ?>

<fieldset id="contactUsForm">
<legend><?php echo HEADING_TITLE; ?></legend>
<div class="alert forward"><?php echo FORM_REQUIRED_INFORMATION; ?></div>
<br class="clearBoth" />

<?php
// show dropdown if set
    if (CONTACT_US_LIST !=''){
?>
<label class="inputLabel" for="send-to"><?php echo SEND_TO_TEXT; ?></label>
<?php echo zen_draw_pull_down_menu('send_to',  $send_to_array, 0, 'id="send-to"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
<?php
    }
?>

Rest of it, which I changed a lot on.

<h3>What kind of comment would you like to send?</h3>

<label for="topic"><?php echo ENTRY_TOPIC; ?></label>
<?php echo zen_draw_radio_field('topic', 'type="radio"', 'name="topic"', 'value="Question"') . Question . '    ';
echo zen_draw_radio_field('topic', 'type="radio"', 'name="topic"', 'value="Complaint"') . Complaint . '    ';
echo zen_draw_radio_field('topic', 'type="radio"', 'name="topic"', 'value="Problem"') . Problem . '    ';
echo zen_draw_radio_field('topic', 'type="radio"', 'name="topic"', 'value="Suggestion"') . Suggestion . '    ';
echo zen_draw_radio_field('topic', 'type="radio"', 'name="topic"', 'value="Praise"') . Praise; ?>
<br /><br />




<h3>What about us do you want to comment on?</h3>

<label for="subject"><?php echo ENTRY_SUBJECT; ?></label>
<?php echo zen_draw_radio_field('subject', 'value="Website"') . Website . '    ';
echo zen_draw_radio_field('subject', ' value="Company"') . Company . '    ';
echo zen_draw_radio_field('subject', ' value="Products"') . Products . '    ';
echo zen_draw_radio_field('subject', ' value="Store"') . Store . '    ';
echo zen_draw_radio_field('subject', ' value="Employee"') . Employee . '    ';
echo zen_draw_radio_field('subject', ' value="Order"') . Order . '    ';
echo zen_draw_radio_field('subject', ' value="Other"') . Other; ?>
<br class="clearBoth" />
<br />


<label for="enquiry"><?php echo ENTRY_ENQUIRY; ?></label>
<?php echo zen_draw_textarea_field('enquiry', '30', '7', '', 'id="enquiry"'); ?>
<br class="clearBoth" />

<br />

<h3>Tell us how to get in touch with you:</h3>

<label class="inputLabel" for="contactname"><?php echo ENTRY_NAME; ?></label>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname"'); ?>
<br class="clearBoth" />

<label class="inputLabel" for="email-address"><?php echo ENTRY_EMAIL; ?></label>
<?php echo zen_draw_input_field('email', ($error ? $_POST['email'] : $email), ' size="40" id="email-address"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />

<label class="inputLabel" for="zipcode"><?php echo ENTRY_ZIPCODE; ?></label>
<?php echo zen_draw_input_field('zipcode', ($error ? $_POST['zipcode'] : $zipcode), ' size="40" id="zipcode"'); ?>
<br class="clearBoth" />

<label class="inputLabel" for="phone"><?php echo ENTRY_PHONE; ?></label>
<?php echo zen_draw_input_field('phone', ($error ? $_POST['phone'] : $phone), ' size="40" id="phone"'); ?>
<br class="clearBoth" />

<label class="inputLabel" for="fax"><?php echo ENTRY_FAX; ?></label>
<?php echo zen_draw_input_field('fax', ($error ? $_POST['fax'] : $fax), ' size="40" id="fax"'); ?>
<br class="clearBoth" />

<br />

<label for="urgent"><?php echo ENTRY_URGENT; ?></label>
<?php echo zen_draw_checkbox_field('urgent', ' id="urgent"') . "Please contact me as soon as possible regarding this matter"; ?><br /><br />


</fieldset>

<h3 align="center">This form could take as long as 30 seconds to process. Please only hit the send button once.</h3>
<p align="center"><span class="importantinfo">*</span>An e-mail address is necessary to process your request. We do not sell, rent or exchange names with other companies.<br />Please refer to our Online Private Policy if you are concerned with leaving your name and address with our company.</p>
<p align="center"><span class="importantinfo">If you are under the age of 18 please ask your parents permission before disclosing personal information.</span></p>

<div class="buttonRow forward"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT); ?></div>
<div class="buttonRow back"><?php echo zen_image_submit(BUTTON_IMAGE_SEND, BUTTON_SEND_ALT) . '</a>'; ?></div>
<?php
  }
?>
</form>
</div>

Here is the whole original tpl file:

<?php
/**
 * Page Template
 *
 * Loaded automatically by index.php?main_page=contact_us.<br />
 * Displays contact us page form.
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_contact_us_default.php 4272 2006-08-26 03:10:49Z drbyte $
 */
?>
<div class="centerColumn" id="contactUsDefault">

<?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')); ?>

<?php if (CONTACT_US_STORE_NAME_ADDRESS== '1') { ?>
<address><?php echo nl2br(STORE_NAME_ADDRESS); ?></address>
<?php } ?>

<?php
  if (isset($_GET['action']) && ($_GET['action'] == 'success')) {
?>

<div class="mainContent success"><?php echo TEXT_SUCCESS; ?></div>

<div class="buttonRow"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>

<?php
  } else {
?>

<?php if (DEFINE_CONTACT_US_STATUS >= '1' and DEFINE_CONTACT_US_STATUS <= '2') { ?>
<div id="contactUsNoticeContent" class="content">
<?php
/**
 * require html_define for the contact_us page
 */
  require($define_page);
?>
</div>
<?php } ?>

<?php if ($messageStack->size('contact') > 0) echo $messageStack->output('contact'); ?>

<fieldset id="contactUsForm">
<legend><?php echo HEADING_TITLE; ?></legend>
<div class="alert forward"><?php echo FORM_REQUIRED_INFORMATION; ?></div>
<br class="clearBoth" />

<?php
// show dropdown if set
    if (CONTACT_US_LIST !=''){
?>
<label class="inputLabel" for="send-to"><?php echo SEND_TO_TEXT; ?></label>
<?php echo zen_draw_pull_down_menu('send_to',  $send_to_array, 0, 'id="send-to"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
<?php
    }
?>

<label class="inputLabel" for="contactname"><?php echo ENTRY_NAME; ?></label>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />

<label class="inputLabel" for="email-address"><?php echo ENTRY_EMAIL; ?></label>
<?php echo zen_draw_input_field('email', ($error ? $_POST['email'] : $email), ' size="40" id="email-address"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />

<label for="enquiry"><?php echo ENTRY_ENQUIRY . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?></label>
<?php echo zen_draw_textarea_field('enquiry', '30', '7', '', 'id="enquiry"'); ?>

</fieldset>

<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SEND, BUTTON_SEND_ALT); ?></div>
<div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
<?php
  }
?>
</form>
</div>
11 Sep 2010, 11:03 AM
#3
manya avatar

manya

New Zenner

Join Date:
May 2010
Posts:
23
Plugin Contributions:
0

Re: Adding radio/checkbox fields to Contact Us Form and receiving them in e-mail properly

I have the exact same problem as Salixia allthough I hope you solved it somehow? I'm making a subscriptions form and d'be happy to post it here later. I have three radiobuttons for three alternatives.
What is the correct validation code in the php header for radiobuttons? Also saw Dr Bytes response in another thread about the customer being able to reference the type of order at a later time and it being visible in customers pages in admin. But even the simpler version where I get the answer of what button was marked in the e.mail would be great to start with.

My code looks like this in tpi_default file:

<?php /** * Page Template * * Loaded automatically by index.php?main_page=contact_us.<br /> * Displays contact us page form. * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_contact_us_default.php 3230 2006-03-20 23:21:29Z drbyte $ */ ?> <div class="centerColumn" id="subscriptions"> <?php echo zen_draw_form('subscriptions', zen_href_link('subscriptions', 'action=send')); ?> <?php if (isset($_GET['action']) && ($_GET['action'] == 'success')) { ?> <div class="mainContent success"><?php echo TEXT_SUCCESS; ?></div> <div class="buttonRow"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div> <?php } else { ?> <?php if (DEFINE_SUBSCRIPTIONS_STATUS == '1') { ?> <div id="subscriptionsContent" class="content"> <?php /** * require html_define for the contact_us page */ require($define_page); ?> </div> <?php } ?> <?php if ($messageStack->size('contact') > 0) echo $messageStack->output('contact'); ?> <fieldset id="subscriptionsForm"> <legend><?php echo HEADING_TITLE; ?></legend> <div class="alert forward"><?php echo FORM_REQUIRED_INFORMATION; ?></div> <br class="clearBoth" /> <?php // show dropdown if set if (CONTACT_US_LIST !=''){ ?>

<label class="inputLabel" for="send-to"><?php echo SEND_TO_TEXT; ?></label>

<?php echo zen_draw_pull_down_menu('send_to', $send_to_array, 'id=\"send-to\"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?> <br class="clearBoth" /> <?php } ?> <p class="StoryContentColor"><br /> <label for="yes1">Alt.1<?php echo SUBS_ON_GOING; ?></label> <input type="radio" id="yes1" name="radiobutton" value="ongoing" checked="checked" /> <br />
    </p>        <p class="StoryContentColor"> <br />
      <label for="yes2">Alt.2<?php echo SUBS_SIX_MONTHS; ?></label>
      <input type="radio" id="yes2" name="radiobutton" value="sixmonths"  />
	  
	  <p class="StoryContentColor"> <br />
      <label for="yes3">Alt.3<?php echo SUBS_FULL_YEAR; ?></label>
      <input type="radio" id="yes3" name="radiobutton" value="fullyear"  />

<label class="inputLabel" for="contact_name"><?php echo ENTRY_NAME; ?></label>

<?php echo zen_draw_input_field('contact_name', $name, ' size="40" id="contact_name"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?> <br class="clearBoth" />

<label class="inputLabel" for="contact_company_name"><?php echo ENTRY_COMPANY_NAME; ?></label>

<?php echo zen_draw_input_field('company_name', ($error ? $_POST['company_name'] : $company_name), ' size="40" id="company_name"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?> <br class="clearBoth" />

<label class="inputLabel" for="delivery_address"><?php echo ENTRY_DELIVERY_ADDRESS; ?></label>

<?php echo zen_draw_textarea_field('delivery_address', ($error ? $_POST['delivery_address'] : $delivery_address), ' size="30" id="delivery_address"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?> <br class="clearBoth" />

<label class="inputLabel" for="delivery_address_other"><?php echo ENTRY_DELIVERY_ADDRESS_OTHER_THAN_OWN; ?></label>

<?php echo zen_draw_textarea_field('delivery_address_other', '30', '3', '', 'id="delivery_address_other"'); ?> <br class="clearBoth" />

<label class="inputLabel" for="phone_number"><?php echo ENTRY_PHONE; ?></label>

<?php echo zen_draw_input_field('phone_number', ($error ? $_POST['phone_number'] : $phone_number), ' size="40" id="phone_number"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?> <br class="clearBoth" />

<label class="inputLabel" for="email_address"><?php echo ENTRY_EMAIL; ?></label>

<?php echo zen_draw_input_field('email_address', ($error ? $_POST['email_address'] : $email_address), ' size="40" id="email_address"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?> <br class="clearBoth" />

<label class="inputLabel" for="dob"><?php echo ENTRY_DOB; ?></label>

<?php echo zen_draw_input_field('dob', ($error ? $_POST['dob'] : $dob), ' size="20" id="dob"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?> <br class="clearBoth" />

<label class="inputLabel" for="comments"><?php echo ENTRY_COMMENTS; ?></label>

<?php echo zen_draw_textarea_field('comments', '30', '7', '', 'id="comments"'); ?> </fieldset> <input type="submit"> <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SEND, BUTTON_SEND_ALT); ?></div> <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div> <?php } ?> <br class="clearBoth" /> </form> </div>

Everything shows except the radiobutton aswers which displays like this in my e-mail:

Från: Anna Lindstrl
Email: [email protected]
Subs_On_Going:

Subs_Six_Months:

Subs_Full_Year:

Name:

Company_Name:
Yieojom Ab
Address:
Tykurtart 45 76589 Olsma
Address:


Phone: 075839201
DOB: 760706-5679
Comments:

No Yes next to any of the alternatives..

And the header.php file looks like this:

<?php /** * Contact Us Page * * @package page * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: header_php.php 3230 2006-03-20 23:21:29Z drbyte $ */ require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php')); $error = false; if (isset($_GET['action']) && ($_GET['action'] == 'send')) { $name = zen_db_prepare_input($_POST['contact_name']); $email_address = zen_db_prepare_input($_POST['email_address']); $zc_validate_email = zen_validate_email($email_address); if ($zc_validate_email and !empty($name)) { // auto complete when logged in if($_SESSION['customer_id']) { $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id FROM " . TABLE_CUSTOMERS . " WHERE customers_id = :customersID"; $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer'); $check_customer = $db->Execute($sql); $customer_email= $check_customer->fields['customers_email_address']; $customer_name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname']; } else { $customer_email='Not logged in'; $customer_name='Not logged in'; } // use contact us dropdown if defined if (CONTACT_US_LIST !=''){ $send_to_array=explode("," ,CONTACT_US_LIST); preg_match('/\<[^>]+\>/', $send_to_array[$_POST['send_to']], $send_email_array); $send_to_email= eregi_replace (">", "", $send_email_array[0]); $send_to_email= eregi_replace ("<", "", $send_to_email); $send_to_name = preg_replace('/\<[^*]*/', '', $send_to_array[$_POST['send_to']]); } else { //otherwise default to EMAIL_FROM and store name $send_to_email = EMAIL_FROM; $send_to_name = STORE_NAME; } // Prepare extra-info details $extra_info = email_collect_extra_info($name, $email_address, $customer_name, $customer_email); // Prepare Text-only portion of message $text_message = OFFICE_FROM . "\t" . $name . "\n" . OFFICE_EMAIL . "\t" . $email_address . "\n" . "Subs_On_Going:\n" . $selected_radio =($_POST['subs_on_going']) . "\n" . "Subs_Six_Months:\n" .$selected_radio =($_POST['subs_six_months']) . "\n" . "Subs_Full_Year:\n" . $selected_radio =($_POST['subs_full_year']) . "\n" . "Name:\n" . strip_tags($_POST['customer_name']) . "\n" . "Company_Name:\n" . strip_tags($_POST['company_name']) . "\n" . "Address:\n" . strip_tags($_POST['delivery_address']) . "\n" . "Address:\n" . strip_tags($_POST['delivery_address_other_than_own']) . "\n" . '------------------------------------------------------' . "\n\n" . "Phone:\t\t" . strip_tags($_POST['phone_number']) . "\n" . "DOB:\t\t\t" . strip_tags($_POST['dob']) . "\n" . "Comments:\n" . strip_tags($_POST['comments']) . "\n" . '------------------------------------------------------' . "\n\n" . $extra_info['TEXT']; $html_msg['EMAIL_MESSAGE_HTML'] = nl2br($text_message); // Prepare HTML-portion of message //$html_msg['EMAIL_MESSAGE_HTML'] = strip_tags($_POST['enquiry']); $html_msg['CONTACT_US_OFFICE_FROM'] = OFFICE_FROM . ' ' . $name . '<br />' . OFFICE_EMAIL . '(' . $email_address . ')'; $html_msg['EXTRA_INFO'] = $extra_info['HTML']; // Send message zen_mail($send_to_name, $send_to_email, 'Body Mind Elements shop: Subscriptions', $text_message, $name, $email_address, $html_msg,'subscriptions'); zen_redirect(zen_href_link('subscriptions', 'action=success')); } else { $error = true; if (empty($name)) { $messageStack->add('contact', ENTRY_EMAIL_NAME_CHECK_ERROR); } if ($zc_validate_email == false) { $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } if (empty($enquiry)) { $messageStack->add('contact', ENTRY_EMAIL_CONTENT_CHECK_ERROR); } } } // end action==send // default email and name if customer is logged in if($_SESSION['customer_id']) { $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id FROM " . TABLE_CUSTOMERS . " WHERE customers_id = :customersID"; $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer'); $check_customer = $db->Execute($sql); $email_address = $check_customer->fields['customers_email_address']; $name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname']; } if (CONTACT_US_LIST !=''){ foreach(explode(",", CONTACT_US_LIST) as $k => $v) { $send_to_array[] = array('id' => $k, 'text' => preg_replace('/\<[^*]*/', '', $v)); } } // include template specific file name defines $define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', 'define_subscriptions.php', 'false'); $breadcrumb->add(NAVBAR_TITLE); ?>

WHAT AM I MISSING PLEASE!? I've tried working this out on my own for a while now.. would be most happy to get some input!

Dr Byte..? Anyone?

Thanks in advance!:wacko: