Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI Excecutable 1

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hello,

I'm not a Delphi coder, I left Borland in the days of Paradox & DOS!

However, I met with a company and was talking with their programmers and they showed me a web app, this app was simply a URI with an exe extention.

I'd not seen this before and asked what this was, they said it was a CGI executable written in Delphi, and they could compile it to a DLL instead.

How does this work, how do you write web apps that run in these type of languages as a compiled DLL.

I understood Delphi to be a compiled local machine executable, based on the Pascal language. And you design and create apps similarly to VB or FoxPro.

How do you turn this into a web app?



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
There's a lot that can be said on the topic. Any app that writes in the console to STDOUT and reads from STDIN can basically be a CGI app. It's not a matter of language, but more following a standard, much like a web browser can be written in any language that follows the HTTP standard.

Now a lot of companies have seized upon the interest that web apps have brought and have written components/procedures in order to follow the standards required for CGI, but you can write a CGI web app in any language, even a DOS language such as Turbo Pascal.

For grins and giggles, here's a simple "Hello World!" program which worked in Turbo Pascal. Forms and interactions are a bit more complex, though the standard handles those, too (and can be done in any programming language).

Code:
program pas27_01;

  const
    html_mime_type = 'Content-type: text/html';
    document_separator = #13#10#13#10#13#10#13#10#13#10;

  begin
    write(html_mime_type);
    write(document_separator);
    write('<HTML>');
    write('<TITLE>Hello World CGI Test</TITLE>');
    write('<BODY>');
    write('<H1>Hello World</H1>');
    write('</BODY></HTML>');
  end.
 
How does this work, how do you write web apps that run in these type of languages as a compiled DLL.

Oops I see I didn't get around to answering this one. There are three ways (I know of) to handle CGI applications. Executables, or NSAPI standard DLL, or ISAPI standard DLL. As you can guess, this stuff was set up in the time of the Netscape/IE browser war, so that's where the two competing standards came from.

Basically the programmer follows the standard in whatever language they have, and most languages, today, will have tools to automate this.
 
thank you for such a concise and detailed explanation, much appreciated.

regards,

1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top