I’m trying to pass a double value that are arrays in a tag. How do I receive the and split the arrays apart on the other side? This is the code that I have:
<?php
print("<select name='dsc[]' multiple='multiple' id='searchable-select' multiple>");
//Create new SQL object
$db = new NSC_SQL($db2config);
$db->from($qadbifld, "dbifld, substr(dbitxt,1,25) as FLDTEXT");
$db->where("upper(dbiatr)='PF' and (DBILIB='".$nscmod72d."' or DBILIB='".$aedata72."') ");
$db->group("dbitxt,dbifld");
$db->order("dbitxt,dbifld");
$db->select();
$results = $db->fetchAssoc();
foreach($results as $row)
{
$fieldName = trim($row['DBIFLD']);
$fieldDesc = trim($row['FLDTEXT']);
print("<option VALUE='$fieldDesc,$fieldName'>$fieldDesc - $fieldName </option>");
}
print("</select>");
?>
This is how I’m trying to receive it on the other side:
<?PHP
$dsc = $_POST['dsc'];
list($fieldDesc, $fieldName) = explode(":", $dsc);
//Put the elements of the array in hidden fields here!
print_r($fieldDesc);
print_r($fieldName);
foreach ($fieldDesc as $key => $value1)
{
echo "<input type=hidden name='dsc[]' value='$value1'>";
}
?>
This is wrote in PHP
It has to be this way so that only one option is passed to the multi-select box.
Thanks for any help you guys may have for me.
You have multiple select element
Consider the code below
If you dont get let me know