×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Basic questions about CGI
2

Basic questions about CGI

Basic questions about CGI

(OP)
I am new to CGI and have some confusion.

What is CGI ? Is it a set of standards which must be followed while communicating between server and CGI script ? How does a server know that a particular program script is following CGI standards ? I have seen cgi-bin directory. If I put a script in this directory, does it mean that program is CGI program ? What happens if I put a program in cgi-bin directory, which is not CGI program ? How do I make my perl script a CGI program script ? Where do I mention that this is CGI script and do I have to provide .cgi extnsion to make it a cgi script ? which are the other standards like CGI to run server side programs based on request from a client ? Perl script is used to write CGI programs, can I use java to write CGI script ?

Pls answer all questions

Thanks
 

RE: Basic questions about CGI

2
Hi

Quote (jjsoni):

Is it a set of standards which must be followed while communicating between server and CGI script ?

Yes.

Quote (jjsoni):

How does a server know that a particular program script is following CGI standards ?

It does not know.

Quote (jjsoni):

I have seen cgi-bin directory.

That is web server specific.

Quote (jjsoni):

If I put a script in this directory, does it mean that program is CGI program ?

No. But usually supposed. Restricting the execution of external applications to a specific location is for security.

Quote (jjsoni):

What happens if I put a program in cgi-bin directory, which is not CGI program ?

Nothing special. The program will do what it can. Most probably the web server will detect the absence of HHTP response headers in the executed application's output and will send status 500 ( Internal Server Error ) back to the user agent. But this depends on the web server.

Quote (jjsoni):

How do I make my perl script a CGI program script ?

Use the CGI module. But nothing but you can guarantee that the script will actually act as CGI application.

Quote (jjsoni):

Where do I mention that this is CGI script and do I have to provide .cgi extnsion to make it a cgi script ?

Nowhere. The requirement for a given extension is web server specific. On some operating systems there are no extensions, on other operating systems certain extensions are mandatory for some file types and can not be changed freely. So usually there is no requirement set for file extension. The .cgi is just a habit.

Quote (jjsoni):

which are the other standards like CGI to run server side programs based on request from a client ?

There are few, but none is so widely implemented and used as CGI. For example, FastCGI, SCGI. Also there are web server specific ones. For example, LRWP for Xitami.

Quote (jjsoni):

Perl script is used to write CGI programs, can I use java to write CGI script ?

Yes. The basic requirements for a programming language to be suitable for CGI applications are few :
  • read from standard input
  • write to standard output
  • read environment variables
Although it is possible, writing CGI in Java is not common. Just google for java cgi for more.

Feherke.
http://rootshell.be/~feherke/

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close