[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: Changing multiple value delimeter
****** message to minivend-users from allan@instantsoft.com ******
Thanks for replying Mike. I was actually trying to
get the values from within a [sql set][/sql db] and
embedded perl doesn't seem to work within these tags
(at least I haven't had any luck making it work) so
trying to split on the nulls was not a solution. I even
tried using a GlobalSub where the global sub would do the splitting
and then doing a
[sql set]
insert into mydb
values
(
'[value val1]',
'[perl sub] doSplitOnNull("[value multival]") [/perl]',
etc...
)
[/sql mydb].
This works (well kinda works) fine, but instead of inserting
the return value of doSplitOnNull, it inserts
'[perl sub] doSplitOnNull("[value multival]") [/perl]'. But luckily,
with a bit of experimenting, I managed to get it to work using
some other MV tags. Maybe I'll try using the new stuff in version
12 later (I'm still using 3.08!).
On Thu, 11 Mar 1999 mikeh@minivend.com wrote:
> ****** message to minivend-users from mikeh@minivend.com ******
>
> Quoting allan@instantsoft.com (allan@instantsoft.com):
> > ****** message to minivend-users from allan@instantsoft.com ******
> >
> >
> > sub parse_post {
> > my(@pairs, $pair, $key, $value);
> > undef %CGI::values;
> > return unless defined $CGI::post_input;
> > @pairs = split(/&/, $CGI::post_input);
> > foreach $pair (@pairs) {
> > ($key, $value) = ($pair =~ m/([^=]+)=(.*)/)
> > or die "Syntax error in post input:\n$pair\n";
> > $key = unhexify($key);
> > $value =~ s/\+/ /g;
> > $value = unhexify($value);
> > # Handle multiple keys
> > unless (defined $CGI::values{$key}) {
> > $CGI::values{$key} = $value;
> > }
> > else {
> >
> >
> > #############################
> > ## QUESTION HERE
> > ## QUESTION HERE
> > #############################
> > ## If I change "\0" below to something else like
> > ## say '|' , will minivend break?
>
> It will crash so hard the pieces would be impossible to pick up.
>
> > If yes, does anyone
> > ## know how to get all the values from a select multiple
> > ## using [value varname]? The way it is right now, if you
> > ## do something like:
> > ## <select name=vname multiple size=4>
> > ## <option value=1>1
> > ## <option value=2>2
> > ## <option value=3>3
> > ## </select>
> > ## [value vname] returns only one value.
> > ##
>
> Split on nulls, or use MV3.12's new value-extended tag.
> -
> To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
> email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
> Archive of past messages: http://www.minivend.com/minivend/minivend-list
>
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list