Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
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 little error message. And you see that it has these dollar signs on either side of the word CONFIRM_ERROR.
Likewise, here is the action attribute to the form element and it has a token called SELF and this is a callback variable. It has the relative path back to the application. So for example, if I look at this form here on the web and I look at the View Source, you see here in form action it has the path, the relative URL, back to application itself. And in the HTML, we see it has $SELF$ and on the web it has this value filled in.
It's integrated into the look-and-feel of the website. This technique allows us to do that. We can take those HTML elements and we can wrap them around these tokens and the tokens fill in what's necessary to make the application work. So as part of our case study here, we are actually going to do that and you'll see how that works in action.
Get unlimited access to all courses for just $25/month.Become a member
61 Video lessons · 100152 Viewers
56 Video lessons · 113177 Viewers
71 Video lessons · 82035 Viewers
131 Video lessons · 39365 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.