PDA

View Full Version : Passing Variables from one FOrm Page to another Form Page



icesha
Sep 9th, 2007, 03:28 AM
Hi. I just want to ask how can i pass variable from a page to another using query string. I have to score a specific quiz. Wherein, I have to calculate the score from a page to another. The event that will trigger it is a button. If the answer is correct, add 10 points if not, no point should be added and score should be shown at the last page. here is an example of my code.
please help me. i'm new in using javascript. thanks.

function incorrect()
{
alert("OOPS! Bad Answer! Your Answer is incorrect!!");
window.close("http://localhost/xampp/ECSEL/newecsel/exercisestest.php")
window.open("http://localhost/xampp/ECSEL/newecsel/exercisestest1.php?score=0")

}
function correct()
{
alert("GOOD WORK!! The answer Compound Sentence is correct. ");
alert("This is a compound sentence, because it contains two independent clauses joined by the co-ordinating conjunction AND.");
window.close("http://localhost/xampp/ECSEL/newecsel/exercisestest.php")
window.open("http://localhost/xampp/ECSEL/newecsel/exercisestest1.php?score=10")
}


<%
Response.Write(Request.QueryString)
Response.Write(Request.QueryString("score"))
%>