• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

help with asp

tichuot

New Member
could anyone tell me why my counter isn't working

<html>
<body>

<FORM METHOD="POST" ACTION="login.asp">
UserName-----><INPUT TYPE=TEXT NAME=user size="20"><BR>
Password-----><INPUT TYPE=TEXT NAME=pw size="20"><BR><BR>
<INPUT TYPE=SUBMIT NAME=sumit value="Login">
</FORM>

<b>Messages:</b>
<br><br>
<font color="red">

<%
Dim kounter

if Request("user")="" And Request("pw")="" Then
kounter=kounter+1
Response.write "You haven't entered anything!"
Elseif Request("user")="" then
kounter=kounter+1
Response.write "You haven't entered your name!"
Elseif Request("pw")="" then
kounter=kounter+1
Response.write "You haven't entered your password!"
Elseif Len(Request("user"))>8 then
kounter=kounter+1
Response.write "You may not use more than 8 characters for your username!"
Elseif Len(Request("pw"))>8 then
kounter=kounter+1
Response.write "You may not use more than 8 characters for you password!"
Else
session("user")=Request("user")
session("pw")=Request("pw")
Response.redirect "input.asp"
End if

Response.write "<br>"
Response.write "Counter: "
Response.write kounter
%>

</font>
</body>
</html>
 
I dont know exactly if VBS iniatialize your variable kounter to 0 when u declare it,anyhow try inialize it urself to 0 first time.
and if u r trying to access Form elements then use

if Request.QueryString("user")=""

or

Request.Form("user")()=""

Also if you r using same script for login and validation then it would look like!
Code:
<%
if request.querystring("submit")="" then
%>
<html>

html goes here
.
.
.
<%
else

..process counter



end if
%>
 
I dont know exactly if VBS iniatialize your variable kounter to 0 when u declare it,anyhow try inialize it urself to 0 first time.
and if u r trying to access Form elements then use

if Request.QueryString("user")=""

or

Request.Form("user")()=""

Also if you r using same script for login and validation then it would look like!
Code:
<%
if request.querystring("submit")="" then
%>
<html>

html goes here
.
.
.
<%
else

..process counter



end if
%>
 
Back
Top