| Hit CountersUp until now, every CGI we have used has required the user to hit a 'submit' button on an HTML page, at which point the entire window is replaced by a new page. You could easily write a program using the skills you have already learned to open a count file, add 1, and replace. It would look something like this: #******** BEGIN BODY ********
$counter++;
#increase $counter by 1.
open (PUTCOUNT,">count.log");
#open count log for output
#******** END BODY ********* If we were to call such a program with a SUBMIT button, the current page would dissapear and be replaced by the output of this program. In order to display the hits on our page, we need a way to execute a program when a page loads, and embed the results back in that same page. This method is called a Server Side Include (SSI). NOTE: Not all web servers support SSI. Some only work if the pagename ends with ".shtml" or ".html-ssi" and some have it completely disabled for security purposes. If you have difficulty with this exercise, check with your system administrator. Here's how it works:
That's all so far, please send me your comments
| ||
| |||
Home | WebData - Web Database Software | Javascript | CGI | Consulting | Map Builder | Contact Us | The Press Room |