in reply to Re^2: Loading a web page automatically
in thread Loading a web page automatically

Well you could use a templating system such a Mason;)
Though if page1 is a form with
<input type="hidden" name="next_page" value="/quiz/page2.html">
and you grab the next_page parameter in your script, then print a 302 redirect directive as described above, the browser should load the next page.

Alternatively you could have several hidden divs and change the style of the completed one to display: none; using Javascript, there are many ways to go about this as ever.

What does the code, HTML and Perl that you've tried look like?
What response do you see, in the browser?, in your server logs?

Javascript form example

<html> <head> <title>Invisible divs</title> <script> function showDiv(nextDiv) { for ( var divNum = 0; divNum < 4; ++divNum ) // Change 4 to suit n +umber of divs in page { var currentDiv = document.getElementById("div" + divNum); currentDiv.style.display = ( currentDiv.id == nextDiv ) ? "blo +ck" : "none"; } } </script> </head> <body onload="showDiv('div0');"> <!-- change action below to suit your needs--> <form action="/cgi-bin/assesTest.pl"> <div id="div0" style="display: none;"> This will be the only bit visible at first <a href="#" onclick="showDiv('div1')">Next &gt;</a> </div> <div id="div1" style="display: none;"> This will be visible after clicking on the link at the end of the firs +t div <a href="#" onclick="showDiv('div2')">Next &gt;</a> </div> <div id="div2" style="display: none;"> This will be visible after clicking on the link at the end of the seco +nd div <a href="#" onclick="showDiv('div3')">Next &gt;</a> </div> <div id="div3" style="display: none;"> This is the last element to display <input type="submit"> </div> </form> </body> </html>

Replies are listed 'Best First'.
Re^4: Loading a web page automatically
by taemid (Initiate) on Jul 14, 2009 at 08:57 UTC
    Thanks for the sustained interest in my ignorance.

    I have attached the code in my earlier response. The server log is withour any error, while the browser shows

    Status: 302 Moved Location: 127.0.0.1/loc.htm

    I am not at all conversant with java

    If you want I can attach the webpage, but please guide how to attach html on this message board. Or any other way to do it

      We all start in ignorance, that's what makes it fun ;)
      I should have made my advice clearer Status:302 is a HTTP directive to redirect the browser to another page It is used in place of the usual header see Corion's post above.
        Thanks Utilitarian, Corion and perlmonks - for the help, code, advices and good humor. Shall be back with more querries if the need arises - now that I know wher to contact.

        Bye and take care