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
Solved

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

Posted on 2002-04-02
2
585 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

790 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