CGI can't solve the whole problem because is has no timer function. CGI is executed on the server, and the browser is a client. You solve it by adding this to the HTML page you show the visitor:
<head>
<META HTTP-EQUIV="refresh" CONTENT="5;URL=page2.htm">
</head>