Dynamic HTTP Page Generation

The HTTP Server can dynamically alter pages and substitute real-time information, such as input/output status. This is done by using cgi scripting. To incorporate this real-time information, the corresponding CGI file (*.cgi) must contain a text string ‘%xx’, where the ‘%’ character serves as a control code and ‘xx’ represents a two-digit variable identifier. The variable value has a range of 00-99. When the HTTP Server encounters this text string, it removes the ‘%’ character and calls the HTTPGetVar function. If the page requires ‘%’ as a display character, it should be preceded by another ‘%’ character. For example, to display “23%” in a page, put “23%%”. For more information see Microchip's 833B Application note, available from the SBC45EC's product page.

Below is an example of how 2 output pins of the PIC CPU can be toggled and monitored via a web page.