Solved

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

Posted on 2002-04-02
2
546 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
2 Comments
 
LVL 7

Accepted Solution

by:
Motaz earned 200 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JSON on ISAPI REST Server using Delphi 2 229
Delphi Form ownership 4 72
delphi parse string to params 3 97
Multi-layered image in FireMonkey 9 15
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

911 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now