Submitting values

<input type="checkbox" name="multilingual" value="english" >english
<input type="checkbox" name="multilingual" value="dutch" >dutch
<input type="checkbox" name="multilingual" value="french" >french
<input type="checkbox" name="multilingual" value="german" >german

In a script I use the checkbox option above.

When I submit the script:
The value $in{'mulitilingual'} becomes:
english dutch french german.

It looks like that the value are seperated by a space.
But I think it isn't so.

When I added the script manual and set the seperator to a space the script works fine. Further on in the script the value $in{'mulitilingual'} will be split using a space as a seperator!!

When the script will try to split the value made by the form the value $in{'mulitilingual'} will not be split but stays as one value:
english dutch french german

Can someone help me??

greetings Michel

mmcwAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hualianCommented:
Hi.

I Think the best method is use CGI
only need 6 line. all you want.

a.cgi

use CGI;
$q=new CGI;
print $q->header;
print $q->start_html;
print $q->param('multilingual');
print $q->end_html;

ofcourse. you may say: i don't want use
CGI.

the another way to do:
you use your orginal script,and recive
the var from the forms. you get one var
with space. you add  follow line:
$youvar=~s" "";
$youvar now have not space seprate.

may be this can give help for you.


ok. if you still have problem,please ask again
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mmcwAuthor Commented:
The problem is I get one variable from the form. It looks like there are spaces between each options. But when I try to split them by using the space to split it will not work!!!!!!

I think the form does not use spaces???
0
hualianCommented:
first you get the variables into one
var.

then use ~s to replace it.

or use split.

i recommd you had better use one var get the variable from the form.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

hualianCommented:
first you get the variables into one
var.

then use ~s to replace it.

or use split.

i recommd you had better use one var get the variable from the form.

if you still have problem,you can show me some code of this script.

thank you..
0
ozoCommented:
How is %in set in your script?
0
mmcwAuthor Commented:
Answer to ozo:
I use cgi-lib
0
ozoCommented:
What version?  Could you post the relevent code?
I think most will separate the values with "\0" in a single scalar string
if you use CGI.pm, (which I'd recommend) it will return the parameters in an array.
0
mmcwAuthor Commented:
This is the version that is used by my script!

# Perl Routines to Manipulate CGI input
# S.E.Brenner@bioc.cam.ac.uk
# $Id: cgi-lib.pl,v 2.8 1996/03/30 01:36:33 brenner Rel $
#
# Copyright (c) 1996 Steven E. Brenner  
# Unpublished work.
# Permission granted to use and modify this library so long as the
# copyright above is maintained, modifications are documented, and
# credit is given for any use of the library.
#
# Thanks are due to many people for reporting bugs and suggestions
# especially Meng Weng Wong, Maki Watanabe, Bo Frese Rasmussen,
# Andrew Dalke, Mark-Jason Dominus, Dave Dittrich, Jason Mathews

# For more information, see:
#     http://www.bio.cam.ac.uk/cgi-lib/

greetings Michel
0
mmcwAuthor Commented:
Maybe I try to explain what I do with the output of the form above:

I write the variable $in{'multilingual'} directly to a file.

When I make a line in my program waht prints the output to the screen, the result is: english dutch french german

It looks like there are space between each option!!

But when I try to use the file where I wrote the $in{'multilingual'} variable to and try to split each option by space,

Something like this:
@r_options = split(/ /,$row[3]);
Where $row[3] is the place where I wrote the variable $in{'multilingual'} to.

it will not work!!!
$r_option[0] = english dutch french german
and
$r_option[1] =
$r_option[2] =
$r_option[3] =

Last option are empty!!

Hope you can help me!!
0
hualianCommented:
This Script is test work ok.

$raw[3]="english dutch french german";
@r_options = split(/ /,$raw[3]);
print "
       $r_options[0] =
       $r_options[1] =
       $r_options[2] =
       $r_options[3] =";

maybe you need do it again.
@r_options = split(/ /,$raw[3]);

@r_option=split(/ /,$r_options[0]);

or

use

@r_options = split(/\0/,$raw[3]);
0
mmcwAuthor Commented:
The \0 option did work
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.