Join Bill Weinman for an in-depth discussion in this video Using HTML templates, part of CGI Essential Training.
The HTML that creates this contact form, with all its form elements and such,…actually lives in a template file on the server.…That template file is read by the CGI application.…It has tokens in it that are replaced by elements that are created by the CGI…application and that's what makes everything work the way that it does.…So let's take a look at this process and see how it works and why we do it this way.…Here is my editor and it's connected to the server and I am going to open this first.html.…This is in the html directory under the bw-contact directory and that's where…these template files live.…
So these are all template files.…I will go ahead and open first.html.…Now, this file is actually read not directly by the server but it's read by…the CGI application.…And as the CGI application reads this file,…it goes ahead and replaces things with values that it creates itself for various…reasons, like for instance here is a place for the CONFIRM_ERRORS.…If you try to submit the form and it's missing a value or something, you get a…
- Understanding the server requirements for CGI
- Installing CGI scripts on Unix and Windows servers
- Coding form elements into an HTML page
- Keeping context with hidden fields on a web form
- Learning best practices for creating CGI content