Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8287661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:06:41+00:00 2026-06-08T12:06:41+00:00

I’m trying to pass a double value that are arrays in a tag. How

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:06:44+00:00Added an answer on June 8, 2026 at 12:06 pm

    You have multiple select element

    Consider the code below

    <?php
    if(isset($_POST) && !empty($_POST)){
        $dsc = $_POST['dsc'];
    
        foreach ($dsc as $val){
    
            $data = explode(",", $val);
            $fieldDesc = $data[0]; 
            $fieldName = $data[1];
    
            echo "<input type=hidden name='dsc[]' value='$fieldDesc'>";
        }
    }
    
    ?>
    
    <form action="" method="post">
    <select name='dsc[]' multiple='multiple' id='searchable-select' multiple size="7">
        <option value="a,1">a,1</option>
        <option value="b,2">b,2</option>
        <option value="c,3">c,3</option>
        <option value="d,4">d,4</option>
        <option value="e,5">e,5</option>
    </select>
    <input type="submit" value="Submit"></input>
    </form>
    

    If you dont get let me know

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.