CIS525 - Lecture#20 - November 13, 2000
What is CGI?
---------------
Common Gateway Interface
Typical applications:
1) forms processing
2) gateway, (Oracle DB)
3) virtual documents
4) server side cickable maps
=> servers - might require specific directories
example:
public_html/cgi-bin
=> or file extensions
examples:
.pl <= Perl extension
.cgi
Can use:
C/C++
C shell
Perl
Tcl
VB
Java
file exists on server, html page points to file
frame.cgi
frame.pl
Perl Code
----------
#!/usr/local/bin/perl
print "content-type: text/html\n\n";
print " Hello World
\n";
print " \n";
file for output must be:
chmod a+rwx
o+w
C++ code:
-----------
#include
void main()
{
cout << "Content-type: text/plain\n\n";
cout << "Hello World\n";
}
g++ compiler doesn't work well, instead try CC, (Solaris C++ compiler)
- you MUST use .C as extension (Note: CC and .C must be in caps!)
HTML file to access a the C++ Program
-------------------------------------
please note the space following the