I can see at least 2 more ways to do it:
Use an iFrame:
Keep a hidden input outside an iFrame. This input records the answers. An iFrame script must append the answer (comma-separated or whatever) to the hidden input in the parent when a question is submitted. A new page gets loaded into the iFrame after that. When the last question is encountered, the iFrame script can update and read the parent input, then determine which url to load, and then load the url into the parent document location.
Use jQuery Ajax: EDITED to remove hidden input which isn't needed here:
Using jQuery Ajax you can load the next question into a main div, and also retain the values of the answers you want in the jQuery script.
EDIT: Here is another way, using CSS and javascript/jQuery:
Load all the questions into ONE page. But only the current question has style='display:block;', the others must have style='display:none'. When a question is answered, use javascript or jQuery to record the answers in a variable. In your case it seems you are only interested in one answer, so it's even easier. Then use your script to change the display attributes depending on which question should show. Finally, if it is the last question which is submitted, you can determine the url and load the next page.
HOW TO GET THE PARAMETER FROM A QUERY STRING:
function getQuery(key_str) {
// return value of key_str variables query string of url
// Example: url = "index.html?answer=5"; if key_str = "answer" then it returns "5"
if(window.location.search) {
var query = window.location.search.substr(1);
var pairs = query.split("&");
for(var i = 0; i < pairs.length; i++) {
var pair = pairs[i].split("=");
if(unescape(pair[0]) == key_str) return unescape(pair[1]);
}
return null;
}
}
function go() {
var answer = getQuery(answer);
var durl = "http://www.defaulturl.com";
switch (answer) {
case '1' : url = "http://www.url1.com"; break;
case '2' : url = "http://www.url2.com"; break;
case '3' : url = "http://www.url3.com"; break;
default : url = durl;
}
window.location.href = url;
return false;
}
<input type="button" value="Submit" name="butt" onclick="return go();">