Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > about CGI

Reply
Thread Tools

about CGI

 
 
joker
Guest
Posts: n/a
 
      08-16-2007
I don't know Perl to build a CGI script but I know C++. I need to
know how the server use a "file.exe" and the html page from the client
browser. In C++ the data I need to consider is stored in arrays or
variables. The html page inside the server how is stored? How a
CGI .exe can find that data?

 
Reply With Quote
 
 
 
 
J.O. Aho
Guest
Posts: n/a
 
      08-16-2007
joker wrote:
> I don't know Perl to build a CGI script but I know C++. I need to
> know how the server use a "file.exe" and the html page from the client
> browser. In C++ the data I need to consider is stored in arrays or
> variables. The html page inside the server how is stored? How a
> CGI .exe can find that data?


You will have a cgi directory on your server (you may to configure that
yourself), this is where you place cgi scripts and binaries.

The cgi has to generate the data that is sent to the user, this includes even
the mime type header (if you forget this, your cgi will not work).

If I remember it right (it's like 7 years ago), the incoming data is read from
the $arg array in main(). Data you store within the program is all up to you.

Here is a good place for you start looking for more information:
http://www.google.com/search?q=write...earch&filter=0

--

//Aho
 
Reply With Quote
 
 
 
 
Sherm Pendley
Guest
Posts: n/a
 
      08-16-2007
joker <(E-Mail Removed)> writes:

> I don't know Perl to build a CGI script but I know C++.


That's OK - CGI is just an interface between the web server and a child
process. It concerns specific environment variables, and what kind of data
the child process must understand and produce on its standard input and
output streams.

Perl is popular for this purpose because of its robust string handling,
which makes it a good fit for working with the text-based data formats that
are very common on the web. But the CGI spec itself is language-agnostic.
Any language, whether compiled or interpreted, can be used to write a CGI.

> I need to
> know how the server use a "file.exe" and the html page from the client
> browser. In C++ the data I need to consider is stored in arrays or
> variables. The html page inside the server how is stored? How a
> CGI .exe can find that data?


It doesn't even need to be an HTML page. A CGI can produce any type of output
using any means the author wants, whether that is reading HTML from a file
and print it, or generating a graph and returning it as GIF image data.

You can find links to information regarding the CGI "standard" - a de facto
standard, which hasn't been formalized as an RFC - at the W3C site:

<http://www.w3.org/CGI/>

One popular library of CGI functions is LibCGI. It's plain C functions, not
C++ classes, but they're callable from C++:

<http://libcgi.sourceforge.net/>

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(CGI-Target)Could not connect to CGI-Proxy John Smith Java 0 05-15-2006 09:21 PM
Python-cgi or Perl-cgi script doubt praba kar Python 1 07-30-2005 08:25 AM
Python CGI - Accepting Input, Invoking Another Process, Ending CGI LarsenMTL Python 4 11-04-2004 05:59 PM
Calling cgi from cgi thru 'system' function. Different behaviour on browser v/s cmd line Shailan Perl 2 12-15-2003 04:26 PM
Re: CGI Perl "use CGI" statement fail Jürgen Exner Perl 0 07-31-2003 02:00 PM



Advertisments