Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

delphi webbroker: passing multiple parameters and using response.contents...help!

Posted on 2002-04-02
2
Medium Priority
?
701 Views
Last Modified: 2010-04-04
Hi there,

Hopefully this is one of those questions you say "cool easy points".

I'm using Delphi webbroker for the first time creating dynamic web pages. I've got a cgi program running on the server verifying login and p/w info from "loginpage.htm" (the FORM ACTION on "checker.exe" runs this and is the default action of this .exe). A successful login brings up a page with a listbox with some values in it. I want to use those values selected. I.e the user chooses "apple" in the listbox, clicks "buy apple" and that runs another action of the same executable. It would be easy if i could have two submit buttons (i've used one for logging in of course).

I've used request.contentfields to get the first set of values (eg login and p/w) but when i use it to get the listbox values i can't get anything. How do i do it? Do i need to create a seperate .exe? Can i specify if the request was from page "blah" do this...?

Cheers

Neil
0
Comment
Question by:NeilLewis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
Motaz earned 800 total points
ID: 6915166
Your solution is to use Multiple actions, for example you can have two WebActions:
waLogin
waBuy
in waLogin you can set path as /login, and /buy in waBuy action.
in Login form make the action = "checker.exe/login" and in the form that contains the list box you can set the action in HTML: action="checker.exe/buy", then you can have only one CGI application serves unlimited number of actions.

I'll post here this topic from my EBook Delphi Programming Guide (Web development chapter) www.geocities.com/motaz1:

----------------------

In real web server programming you need to write multiple actions for different requests. For instance if you need to write a telephone directory which contains search and subscription forms you didn't need to write two web applications: one for search and one for subscription such as:

http://MyServer/WebSer/search.exe

http://MyServer/WebSer/sub.exe

Instead you can write only one web application and create two web item actions, the first one can be called waSearch and the other waSub. waSearch contains /search in it's PathInfo property and waSub contains /sub in it's PathInfo. PathInfo property makes your web server respond to your request according to passed path, for example if you pass below URL to your application:


http://MyServer/WebSer/phone.exe/search

The first action will be executed (waSearch), and if you pass below URL:

http://MyServer/WebSer/phone.exe/sub

The second action will be executed to respond to your request.

You can combine PathInfo with parameters such as:

http://MyServer/WebSer/phone.exe/search?name=Motaz

Returned value of Query property of Request will be: "name=Motaz"

By this method you can write only one web server application to respond to multiple HMTL forms and queries.

There is a complete code of Telephone directory application with this article. Copy this sample to a directory and make a WWW Alias for it. Make sure that read and execute permission is checked for that Alias.

There is a third action in this example called waAll which returns all records. To call this action write:

http://MyServer/WebSer/phone.exe/all


------------------------
Also I have an associated example with this topic if you want you can tell me your E-Mail to send it to u.
Motaz
0
 

Author Comment

by:NeilLewis
ID: 6915283
Thanks heaps, that should do the trick.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question