If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

'Check the data has been entered into the fields'if username == null then response.write("Please enter a username")response.Endelse if password == null then response.write("Please enter a password")response.End end if

You can *ONLY* use the SET keyword in VBS with objects. Request.Form("...") produces a string, which is not an object in VBS.

*****

WRONG:

Code:

if username == null then

The value from Request.Form() or Request.String() is never null unless the named field did not even exist in the posted data. In other words, unless you posted from the wrong page.

My preferred coding:

Code:

username = Trim(Request.Form("username"))
If username = "" Then
...

***********

Way wrong:

Code:

if username == null then
response.write("Please enter a username")
response.End
else if password == null then
response.write("Please enter a password")
response.End
end if

First of all, VBS doesn't have an == operator. You must use just =

In VBS, when used as above, ELSEIF must be all one word, no space.

But Response.End *IMMEDIATELY* terminates any response. So there is no need for the elseif.

Just code:

Code:

if username = ""l then
response.write "Please enter a username"
response.End
End If
If password = ""l then
response.write "Please enter a password"
response.End
End If

Note that I omitted the parentheses in Response.Write. Although they will work, they are technically an error. Response.Write is a SUB, not a FUNCTION. And you don't use parens when calling a SUB in VBS. They work because ("...") is seen as a single expression. If this were a SUB that took two arguments, though, you'd get an error.

In short... You pretty much have hash there.

Get ASP working and start debugging.

An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.