[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: Creating and processing forms that access a database
This may help with the first question:
On a MV page use a form like:
<form action="[process-target]" method="POST">
<input type="Hidden" name="mv_doit" value="return">
<input type="Hidden" name="mv_nextpage" value="template.html">
Name: <input type="Text" name="name" size="25" maxlength="100"><br>
<input type="Submit" name="mv_submit" value="Send">
</form>
Then on template.html
[value name] returns the value entered in the text box 'name'
or inside perl tags:
[perl values]
return $Safe{'values'}{name};
[/perl]
Kyle Cook
At 11:48 PM 8/14/99 +0300, you wrote:
>****** message to minivend-users from "Reuven M. Lerner"
><reuven@lerner.co.il> ******
>
>I thought that I had figured out how to use MiniVend, but I'm trying
>to accomplish something seeming simple, and getting nowhere fast.
>
>I have to use MiniVend for a task that I know how to accomplish with
>CGI: Submitting a form to the server, and having a CGI program
>retrieve the form elements, use them to query an SQL database, and
>give the results to the user.
>
>Specifically, I would like to know two things:
>
>(1) What is the generic way for me to create a form that is processed
> by a MiniVend template of my choosing? That is, I would like to
> create MiniVend template form.html, whose "submit" button passes
> the HTML form elements to MiniVend template results.html. I have
> been playing with forms, the "mv_doit" hidden tag, and and the
> [value] MiniVend template tag, without much success.
>
> So, how do I duplicate CGI functionality with MiniVend? I don't
> care about the underlying technology, but it's frustrating not to
> know how to pick out form elements.
>
> Must I got through the "search" program? What does that gain me?
>
>(2) I know that MiniVend's query engine is supposed to handle most or
> all of the SQL queries that I might like. But I would like to
> give users a choice of <select> fields in an form, and then
> perform an OR match on them. That is, I would like the resulting
> SQL query to look like
>
> SELECT id, product_name
> FROM Products
> WHERE product.region = 1
> OR product.target_population = 2
> OR product.price = 3
>
> If I use mv_searchfield and mv_searchspec, then it would seem that
> MiniVend always performs an AND search. I want users to be able
> to create an arbitrarily loose or tight search, narrowing things
> as necessary by choosing more elements from <select> lists.
>
>Any ideas? I have been reading the documentation for days, and cannot
>find an obvious solution to either of the above.
>
>Reuven
>
>-
>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
http://www.invisio.com
Web site design, database driven sites,
and shopping cart programming.
Great sites, value priced!