|
Self-running Presentations
| [Previous] [Main] [Next] |
|
| |
| A special type of meta information, called HTTP response headers, can be used to create pages that automatically display other pages after a delay. Such self-running presentations are easily created using the Refresh() method of the htmlMeta class.
| |
|
| |
| #include <stdio.h>
| |
| #include <stdlib.h>
| |
| #include <dcmicro/htmlpp/htmlpp.h>
| |
|
| |
| int main( void )
| |
| {
| |
| htmlCgi server ;
| |
| htmlPage page( "html++ example application" ) ;
| |
|
| |
| // Create a meta tag using HTTP-EQUIV
| |
| // client-pull directive to cause automatic
| |
| // loading of the specified URL in
| |
| // five seconds.
| |
| htmlMeta m ;
| |
| m.Refresh( 5, "http://www.dcmicro.com" ) ;
| |
|
| |
| // Meta information must be placed in
| |
| // in the page Head object.
| |
| page.Head() << m ;
| |
|
| |
| page << "The document at http://www.dcmicro.com "
| |
| << "will automatically display in "
| |
| << "5 seconds." ;
| |
|
| |
| server << page ;
| |
| return 0 ;
| |
| }
| |
|
| |
|
| |
| Content-Type: text/html
| |
| <HTML>
| |
| <HEAD>
| |
| <TITLE>html++ example application</TITLE>
| |
| <META HTTP-EQUIV="refresh" content="5; URL=http://www.dcmicro.com">
| |
| </HEAD>
| |
| <BODY>
| |
| The document at http://www.dcmicro.com will automatically display in 5 seconds.
| |
| </BODY>
| |
| </HTML>
| |
|
| |
| |
|
| |
