SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Feb 2000
    Location
    Portland, OR. USA
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    I'm not new to cgi programming with Perl but I've got a new trick I'm trying to accomplish and I notice that you do this on your homepage at the bottom.

    The trick is parsing out multiple entires in a form fields name. I notice that you are using spinbox and they are accepting multiple "values" for the control "name" listname.

    can you point me to a script that I can use as an example or give me an illustration of how it is done?

    Thanks,
    -Vince

  2. #2
    Destiny Manager Plebius's Avatar
    Join Date
    Nov 1999
    Posts
    682
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could do something like this where you parse the input:

    if ($FORM{$name} && $value)
    {
    $FORM{$name} .= "::$value";
    }
    else
    {
    $FORM{$name} = $value;
    }

    and then to get the data would be something like this:

    @listnames = split(/::/, $FORM{'listnames'});


    ------------------
    "Freedom of the press is limited to those who own one." -A.J. Liebling
    You DO own one. the plebius press


  3. #3
    SitePoint Member
    Join Date
    Feb 2000
    Location
    Portland, OR. USA
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, Thank you.
    Also something like this...
    if ($Form{'colors'}) # add color to database
    {
    $Colors = '';
    @Colors = split (/\0/,$Form{'colors'});

    foreach $Color (@Colors)

    # Here's where we put each color selection into the database.
    # Need the SQL statements here.

    } else
    { &endIt ("Invalid Color selection.");
    }
    }
    }

    Thanks again,
    -Vince


Bookmarks

Posting Permissions

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