Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script produces HTTP Error 405 ??

Status
Not open for further replies.

Portmoon

Programmer
Feb 24, 2003
11
0
0
MY
Hi!

The script below produces HTTP Error 405 (below) when I execute the function calc_score().
<form action=&quot;calc_score&quot; method=&quot;post&quot; name=&quot;myForm&quot;>

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

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>
 
Javascript will not create a 405 error but a server side script will.

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.

Maybe you are trying to do something on the server side which you don't have rights to. Gary Haran
==========================
 
Thanks Xutopia!

I am running the script with PWS and was thinking the same thing. I don't think it accepts 'post' requests???

Cheers.
 
<form action=&quot;calc_score&quot; method=&quot;post&quot; name=&quot;myForm&quot;>
should be
<form action=&quot;calc_score.asp&quot; method=&quot;post&quot; name=&quot;myForm&quot;>
 
Crucial point Discord!!

The script is on the same page as the ASP form, maybe I should create a separate asp file and call it form there??

Thanks!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top