create web app using delphi

shanng
shanng used Ask the Experts™
on
Hi,

anyone know how to create web application using delphi accessing Oracle database? I came across Websnap, web service but don't know how to choose or use them.
thanks

san
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2008

Commented:
look at ISAPI/CGI apps.
ziolko.
Hi,

1.From File-New select 'Web server app'.
2.From the next menu select 'CGI standalone exe'.
3.You will see a tree WebModule1-Actions. Select 'Actions', right-click on it and select 'Add Item' from the popup menu. WebActionItem1 appears.
4.Select that item and change its 'Default' property to True - this means that that item will be executed on every request.
5.Create an OnAction event handler for that item like the following:

procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
 Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
 UserName : string;
begin
 UserName := Request.QueryFields.Values['name'];
 Response.Content := '<HTML><BODY>Hello ' + UserName + '</BODY></HTML>';
 Response.SendResponse;
 Handled := True;
end;

6.Build the CGI app as 'MyCGI.exe' for example and place it on the server.

7. Calling your app from a html page:
Your html link to call that CGI should look like:

<A HREF="www.hostname.com/path/MyCGI.exe?name=John">Click me</A>

Here 'name' is a query field and 'John' is its value, which value will be passed to your app.

Another way:
If you want to use a html form for calling your app, then 1.Change the WebActionItem1 'MethodType' property from mtAny to mtPost. (optional)
2.In the code above use 'ContentFields' instead of 'QueryFields'.
3.Call the app from a html page like:

<HTML>
<HEAD><TITLE><Test Hello CGI></TITLE></HEAD>
<BODY>
<FORM METHOD=POST ACTION="www.hostname.com/path/MyCGI.exe">
<INPUT TYPE=text NAME="name"  VALUE="">
<INPUT TYPE=submit VALUE="Submit">
</FORM>
</BODY>
</HTML>

Regards, Geo
Martyn SpencerSoftware Developer / Linux System Administrator / Managing Director

Commented:
Not a direct answer, but go to www.atozedsoftware.com and take a look at intraweb... getting lots of rave reviews... Played with it myself and it is good. Main disadvantage is that the application mode does not allow browser navigation using back button (because it maintains state independently from the browser).

HTH

Commented:
Hi shanng,
why don't you use Intraweb. It's easy to use and powerful enough.
( if you use delphi 7.0, it's already available in your component palette.)
shanng:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial