Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2006
    Posts
    1

    Question Unanswered: Comma seperated values from Multi-form

    Hello, this is my first post on this forum, so I hope someone can help me and give me great first impression.

    I have a slight problem.

    I use the GET variable, and want a LIST with possibility to make multiple choices view as comma-seperated values in the URL.

    Now (problem)
    PHP Code:
    <select name="smak" size="6" multiple id="smak">
                    <?php
    do {  
    ?>
                    <option value="<?php echo $row_smak['snavn']?>"><?php echo $row_smak['snavn']?></option>
                    <?php
    } while ($row_smak mysql_fetch_assoc($smak));
      
    $rows mysql_num_rows($smak);
      if(
    $rows 0) {
          
    mysql_data_seek($smak0);
          
    $row_smak mysql_fetch_assoc($smak);
      }
    ?>
                  </select>
    And Uses this form thingy
    PHP Code:
    <form method="GET" name="icemaker" id="icemaker" action="index2.php" enctype="multipart/form-data"
    The problem with this is that is gives me a string like:
    smak=value1&smak=value2&smake&value3

    I would like it to show: smak=value1,value2,value3

    How can this be done?

  2. #2
    Join Date
    Apr 2005
    Location
    Baltimore, MD
    Posts
    297
    What is the point of having the comma separated list? smak=value1&smak=value2&smak=value3 is correct and how forms are handled - you don't really want to mess with this. Are you just having trouble parsing the values in your php script after the form is submitted?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •