Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi choice with checkbox


youri99

Recommended Posts

Hello,

 

 

We used the file contact_us.php , and modified it.

 

and rename it contact_salon.php.

 

We used this , to permit customer to subscribe to a "show" .

in this file we selected active "show" and display them on page with

checkbox.

So currently we have 4 "show" , but with the checkbox , it's only the last checkbox

that we can get in result .

 

the code for select and display checkbox was here :

 

<?php

 

$section_query = tep_db_query("SELECT DISTINCT salon_section FROM salon");

$nb_salon = sizeof(tep_deb_query("SELECT salon_id FROM salon"));

while ($section = tep_db_fetch_array($section_query)){

$salon_query = tep_db_query("SELECT * FROM salon WHERE salon_status = '1' AND salon_section = '$section[salon_section]'");

while ($salon = tep_db_fetch_array($salon_query)){

 

?>

 

<tr>

<td class="main"><?php echo tep_draw_checkbox_field('evenement', $salon[salon_title]) . '<b>' . '<font color="#FF6600">' . $salon[salon_title] . '</font><br>' . $salon[salon_size] . '</font></b><br>' . $salon[salon_description] .'<br><br>'; ?> </td>

 

<?php

 

 

}//end while

}//end distinct while

 

?>

 

 

on the beginning on the file we have :

 

 

 

 

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {

$name = tep_db_prepare_input($HTTP_POST_VARS['name']);

$surname = tep_db_prepare_input($HTTP_POST_VARS['surname']);

$societe = tep_db_prepare_input($HTTP_POST_VARS['societe']);

$adress = tep_db_prepare_input($HTTP_POST_VARS['adress']);

$zipcode = tep_db_prepare_input($HTTP_POST_VARS['zipcode']);

$city = tep_db_prepare_input($HTTP_POST_VARS['city']);

$country = tep_db_prepare_input($HTTP_POST_VARS['country']);

$phone = tep_db_prepare_input($HTTP_POST_VARS['phone']);

$email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);

$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);

$evenement = tep_db_prepare_input($HTTP_POST_VARS['evenement']);

 

if ($error == false) {

$enquiry = sprintf(EMAIL_PREAMBLE_TEXT, STORE_OWNER_EMAIL_ADDRESS) . " " . tep_get_ip_address() .

"\n" . EMAIL_NAME . $name .

"\n" . EMAIL_SURNAME . $surname .

"\n" . EMAIL_ADRESS_EMAIL . $email_address .

"\n" . EMAIL_SOCIETE . $societe .

"\n" . EMAIL_ADRESS . $adress .

"\n" . EMAIL_CP . $zipcode .

"\n" . EMAIL_CITY . $city .

"\n" . EMAIL_PHONE . $phone .

"\n" . EMAIL_EVENEMENT . $evenement .

"\n" . EMAIL_ENQUIRY . $enquiry;}

 

and after we send mail , but if you choice more than one "show" , the $http_post_vars['evenement'] containt only the last one.

 

How can we have multi result ??

We don't found the good way to do it .

 

if somebody have an idea , it's very helpfull for us.

 

I'm sorry for my bad English.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...