Solved

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

Posted on 2002-04-02
2
624 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 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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 The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 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