[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: Passing variables from HTML --> MV pages.
****** message to minivend-users from Frank Miedreich <miedreich@acm.org> ******
>****** message to minivend-users from Jason Korkin
><jkorkin@korksoft.com> ******
>
>This is a bit more of a clarification... I have a non-Minivend area, along
>with a Minivend area... I
>am using my own backend user database in the non-MV area, that will
>eventually tie into the MV area.
>What I need to do is pass a value through some means from the non-MV area
>into the MV area. The below
>code does NOT work, because I am not using a form in this area... is there
>any way to pass variable
>name/value pairs via a URL type thing though vlink/tlink?
>
>The offer still stands BTW, the person who gets the answer to this
>question right will have the
>opportunity to have 1 month of free MV hosting on one of our servers.
>
> Thanks,
>
> Jason Korkin.
>
>
>PS> This does not work: [set recnum][value-extended name=recnum][/set],
>and I am running MV 3.11 on
>Linux, perl 5.05_2
>
>
>
>
>
>
>> > ****** message to minivend-users from Jason Korkin
>><jkorkin@korksoft.com> ******
>> >
>> > List:
>> > Urgent question -- how do I pass a variable from a regular HTML
>>page into a Minivend page? I
>> > have a variable / value pair like:
>> >
>> > recnum=234443234
>> >
>> > and I would like to be able to use recnum in my MV pages like [value
>>recnum] or something very
>> > similar. The variable can be passed in pretty much anyway, even by a
>>form; if needed... Any
>> > ideas?
>> >
>
If you need to pass only one variable you can use:
http://www.your-server.com/cgi-bin/vlink/minivend-page?;variable;
the variable (i.e. the string between the two ";") will then be accessable
via [data session arg]. To pass more than one variable simply append
name-value pairs with some kind of unique seperator and parse [data session
arg] with a few lines of perl. The only caveat is that you should not
choose seperators that already have special meaning in URLs, personally I
use XXX and XX.
With this scheme you would call the minivend page in your example with
something like:
http://www.korksoft.com/cgi-bin/korkshop/korkpage?;recnumXX234443234XXXfooXXbar;
and korkpage.html in your minivend pages directory would have something like
[perl arg="values" interpolate=1]
my @pairs = split(/XXX/, '[data session arg]');
foreach $pair (@pairs) {
my ($variable,$value) = split(/XX/, $pair);
$Safe{'values'}->{$variable}=$value;
}
return '';
[/perl]
You would then have the minivend variable "recnum" set to "234443234" and
the minivend variable "foo" set to "bar".
With this scheme X in variable names or values would be a BAD THING (tm),
but you can of course use any other character legal in URLs.
Another possibility:
Basically all minivend pages are accessable via the link you will see when
you look at the source code of minivend generated pages, you would just
delete the session id (minivend will take care of that via cookie) and the
number after the second ";".
If you want to access pages usually available via some kind of form
submission you can also do that after you set the tolerate get flag in
catalog.cfg. You can then pass all the variables you want via the URL, but
will have to make sure to also pass a few minivend variables so it knows
which page to generate. (mv_nextpage comes to mind).
Cheers, Frank
P.S.: Since I did not want the month of minivend hosting, I hid a mistake
in this email. This way I did not get the answer right.
P.P.S: The mistake may be in the P.S. I simply did not test the solution.
P.P.P.S: Cash in all currencies accepted. No questions asked.
--
Frank Miedreich
Max-Planck-Institut fuer psychologische Forschung
-
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