Page 212 - DCAP408_WEB_PROGRAMMING
P. 212
Web Programming
Notes Using a standard web browser, a user can surf to a web page with a form on it and enter
information when the user does this, the information he/she id typing in has not yet been sent
to the Web server. This information is not available for the web sever to process until the user
submits the form by checking the form’s submit button.
Self Assessment
Fill in the blanks:
1. To collect information from the user and to send that information to a separate
………………… for processing.
2. The value tag determines the ………………… value for the form field.
3. The form should be easy for the user to …………………
4. ………………… would work well for the background information on the user’s widget
buying habits.
5. A ………………… should be employed so that the users can select their states.
6. A common use of intranet and Internet server applications is to process a form submitted
by a …………………
8.2 Introduction to CGI Forms and CGI
The communication for static HTML works only one way. There is no way to send information
back to a Web server. To fix this problem, forms and CGI were created. Forms are HTML tags
that allow Web page creators to include controls like check boxes, and radio buttons in their
Web pages. That way, the user can enter information. It also provides a Submit button that sends
the information off to the server.
But now the server has to be smarter, too. It can’t just get requests for pages and send out pages.
The server has to know what to do with this form information when it gets it. That’s where CGI
comes in.
CGI stands for Common Gateway Interface. CGI makes it possible for the Web server to talk to
another application that can handle the form information when it’s sent back. Often these CGI
applications are written in a language called Perl. When the CGI application receives the form
information, it can save it to a text file or store it in a database.
This system works great for simple guest books, but if we want to make our Web pages really
interactive, then we will soon start running into big trouble.
The problem with CGI is that if five people are submitting form information at the same time,
five different copies of the CGI application have to be running on the server to handle them. If
a hundred people are submitting form information at once - a hundred copies of the application
run at the same time. This is a great way to make a popular Web server fall to its knees, start
crawling slowly and then fall over.
Did u know? How to read Form Values from an ASP Page?
The RequestQuery.String and Request.Form commands may be used to retrieve
information from forms, like user input.
206 LOVELY PROFESSIONAL UNIVERSITY