hello max,
Thanks for reply,but its not working as i think in the my first post my problem is not clear..
here i am sending you my all code and screen shot of page...see this and told me where am i wrong...
here the my whole html code..
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: ;">Categeory</label>
<?php
$db=& JFactory::getDBO();
$query = "SELECT cat_name From `jos_chronoforms_Categeory_master`";
$db->setQuery($query);
$rows = $db->loadResultArray();
?>
<select class="cf_inputbox validate-selection" id="select_0" size="1" {cf_multiple} name="select_0">
<option value="">---Select---</option>
<?php
foreach($rows as $row)
{
echo"You are Here";
print_r("<option value='$row'>$row</option>");
}
?>
</select>
</div>
<div class="clear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: ;">Sub Categeory</label>
<?php
$db=& JFactory::getDBO();
$query = "SELECT subcat_name From `jos_chronoforms_subcategeory_master`";
$db->setQuery($query);
$rows = $db->loadResultArray();
?>
<select class="cf_inputbox validate-selection" id="select_1" size="1" {cf_multiple} name="select_1">
<option value="">---Select---</option>
<?php
foreach($rows as $row)
{
echo"You are Here";
print_r("<option value='$row'>$row</option>");
}
?>
</select>
</div>
<div class="clear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: ;">Districts</label>
<?php
$db=& JFactory::getDBO();
$query = "SELECT text_5 From `jos_chronoforms_AddressBook`";
$db->setQuery($query);
$rows = $db->loadResultArray();
?>
<select class="cf_inputbox validate-selection" id="select_2" size="1" {cf_multiple} name="select_2">
<option value="">---Select---</option>
<?php
foreach($rows as $row)
{
echo"You are Here";
print_r("<option value='$row'>$row</option>");
}
?>
</select>
</div>
<div class="clear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: ;">City</label>
<?php
$db=& JFactory::getDBO();
$query = "SELECT text_7 From `jos_chronoforms_AddressBook`";
$db->setQuery($query);
$rows = $db->loadResultArray();
?>
<select class="cf_inputbox validate-selection" id="select_4" size="1" {cf_multiple} name="select_4">
<option value="">---Select---</option>
<?php
foreach($rows as $row)
{
echo"You are Here";
print_r("<option value='$row'>$row</option>");
}
?>
</select>
</div>
<div class="clear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: ;">State</label>
<?php
$db=& JFactory::getDBO();
$query = "SELECT text_9 From `jos_chronoforms_AddressBook`";
$db->setQuery($query);
$rows = $db->loadResultArray();
?>
<select class="cf_inputbox validate-selection" id="select_3" size="1" {cf_multiple} name="select_3">
<option value="">---Select---</option>
<?php
foreach($rows as $row)
{
echo"You are Here";
print_r("<option value='$row'>$row</option>");
}
?>
</select>
</div>
<div class="clear"> </div>
</div>
<div id = 'form_type'>
<input type = "checkbox" name="checkbox" id="Name" value="Name" onclick = "alart("cheched")">Name<br>
<input type = "checkbox" name="checkbox1" id="Address" value="Address">Address<br>
<?php
echo "1";
echo $Address; ?>
<input type = "checkbox" name="checkbox2" id="Phone" value="Phone">Phone<br>
<input type = "checkbox" name="checkbox3" id="Email" value="Email">Email<br>
<input type = "checkbox" name="checkbox4" id="Website" value="Website">Website<br>
<input type = "checkbox" name="checkbox5" id=" Organization Detailes
" value=" Organization Detailes"> Organization Detailes
<br>
</div>
<?php
$some_fields = "";
if($_POST['checkbox']=='Name')
{
$some_fields = $some_fields + text_0 + ',';
echo "checked";
}
if($_POST['checkbox1']=='Address')
{
$some_fields = $some_fields + text_4 + ',';
}
if($_POST['checkbox2']=='Phone')
{
$some_fields = $some_fields + text_15 + ',';
}
if($_POST['checkbox3']=='Email')
{
$some_fields = $some_fields + text_13 + ',';
}
if($_POST['checkbox4']=='Website')
{
$some_fields = $some_fields + text_14 + ',';
}
?>
<div class="form_item">
<div class="form_element cf_button">
<input value="Genrate CSV" type="submit"/>
</div>
<div class="clear"> </div>
</div>
and here the my onsubmitcode-after sending mail.
<?php
global $mainframe;
$db =& JFactory::getDBO();
$tablename = 'jos_chronoforms_AddressBook';
$tables = array( $tablename );
$result = $db->getTableFields( $tables );
$table_fields = array_keys($result[$tablename]);
$skip_fields = array('cf_id', 'uid', 'recordtime', 'ipaddress','cf_user_id');
$table_fields = array_diff($table_fields, $skip_fields);
$db->setQuery("SELECT $some_fields FROM ".$tablename."");
$datarows = $db->loadObjectList();
$titcol = 0;
foreach($table_fields as $table_field)
{
if($titcol){$csvline .=",";}
$csvline .= $table_field;
$titcol++;
}
$csvline .="\n";
$datacol = 0;
$rowcount = 1;
foreach($datarows as $datarow)
{
foreach($table_fields as $table_field)
{
if($datacol){$csvline .=",";}
$csvline .= '"'.addslashes($datarow->$table_field).'"';
$datacol++;
}
$csvline .="\n";
$datacol = 0;
$rowcount++;
}
if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT'])) {
$UserBrowser = "Opera";
}
elseif (ereg('MSIE ([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT'])) {
$UserBrowser = "IE";
} else {
$UserBrowser = '';
}
$mime_type = ($UserBrowser == 'IE' || $UserBrowser == 'Opera') ? 'application/octetstream' : 'application/octet-stream';
@ob_end_clean();
ob_start();
header('Content-Type: ' . $mime_type);
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
if ($UserBrowser == 'IE') {
header('Content-Disposition: inline; filename="' . "ChronoForms - ".$tablename." - ".date("j_n_Y").'.csv"');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
}
else {
header('Content-Disposition: attachment; filename="' . "ChronoForms - ".$tablename." - ".date("j_n_Y").'.csv"');
header('Pragma: no-cache');
}
print $csvline;
exit();
?>
and url of my page is...
http://www.abhikalak.com/experiment/index.php?option=com_chronocontact&chronoformname=GenrateCSVsee this page,...here the 5 dropdown box and some check boxes...but only my problem is related to checkbox...here user checked the checkbox and whose checkbox is checked (suppose i checked the name,address,phone (i have a one table where all the value is saved)so genratecsv file is having only selected checkbox field data means that my csv file having only three fiels and it's data), i think u little bit understood my problem plz help me where m i wrong..??
Thanks in advance!!!