| |
How to Send the Document Back to the Client
If you are a beginner, you may find problem with sending the document back to the client. As a beginner very often you may commit errors in formatting the output properly. As a result the server fails to understand it. If you can properly format the output, it will be easy and prompt for the server to understand it. Let us start with the types of document that CGI program deals with. It returns a varied 0of document, that means there are different types of document that CGI programs return back. Such programs include HTML documents, Plain-text document. They even sent back audio clips and video images to the clients. Even the CGI programs can send back reference documents. Therefore, it is most important for you to know all the types of the document are to be sent. The client also must have the knowledge of the type of document he is supposed to get. How the client will know that what type of document you are going to send him? Your CGI program should inform the client about the type of the document it is going to return to him. Here you have to remember that you have to feed the CGI a short header on the output, so that the CGI inform the client whether it is a full document or a reference to any other document. The full document can be of a MIME type. In such a situation you have to inform your server about what kind of document is to be outputting through the full document of MIME type. In the second case, that means in the case of reference document you need just to tell the server about the whereabouts of the new one. You can set the server for automatic output for you. Now, sever have become technically very smart which automatically open new document for you. Whatever may be the type of the document that you want to send back to the client, the CGI program can cope with it.
|
|