Click to See Complete Forum and Search --> : Script produces HTTP Error 405??


Portmoon
03-24-2003, 09:26 AM
Hi!

The script below produces the following error when I execute the function calc_score().
<form action="calc_score" method="post" name="myForm">

It is part of a quiz that is supposed to calculate the users score from ten questions. When the form is submitted a new page should appear giving the user feedback on each question. i.e :-
What the question was
What they're answer was
And the correct answer if thet got it wrong

Questions and answers are stored in array's.

Any help/suggestions would be very welcome!!

Thanks!!
Kieran

Error message:

HTTP Error 405
405 Method Not Allowed
The method specified in the Request Line is not allowed for the resource identified by the request. Please ensure that you have the proper MIME type set up for the resource you are requesting.





<script>

function calc_score() {
var score = 0;
<%for choice = 0 to 9 step 1%>

<html>
<body>

The question was: <=question<%=index%> <BR>
Your answer was: <=answer<%=choice%> <BR>

if (answer<%=choice%> == '<%=answer1(choice)%>')

score = score + 1;

<B>Your answer is correct</B> <BR>

else

<B>The correct answer is: </B>'<%=answer1(choice)%>' <BR>

<%next%>

</body>
</html>
}
</script>:confused:

AdamGundry
03-24-2003, 10:31 AM
Your server is set up not to allow POST requests to the page calc_score. You will need to change your server setup/contact your ISP to enable this, or use the GET request method instead.

Adam

Portmoon
03-24-2003, 02:09 PM
Thanks for replying Adam!!

I am running the script through Microsoft's PWS, is it possible to enable POST requests and if so how??

Cheers,

Kieran