I want to design a summation program that can calculate arbitrary two numbers in range.
But it doesn’t run, I can’t find the error ~
<BODY>
<p align ="center"></p>
<form name = "form1" method ="post" action ="">
<p>enter the range</p>
lower limit<input name ="tlow" type= "text" id ="tlow" size ="10">higher limit
<input name ="thigh" type ="text" id ="thigh" size ="10">
<input type ="submit" name ="submit" value ="sum"
</form>
<%
Dim i, sum,low,high
sum=0
low=request("tlow")
high=request("thigh")
For i=low To high
sum= sum + i
Next
response.write"sum from "& low &"to" & high &"is:"& sum
%>
</BODY>
Your problems are twofold:
Firstly, your input name attribte breaks across two lines. This prevents the page from knowing the name when posting . So:
Should be
Secondly, you need to close your
<BODY>tag at the end correctly:</BODY>