条件を使用して null または '' (空) の非常に単純なフォーム検証チェックを実行しようとしていますが、すべての空白フィールドでフォームを送信すると、コードの後半のセクションが実行されます。
そして、すべてのフィールドに入力すると、他の部分が実行されます。したがって、それらが空白の場合は、条件の最初のセクションであるユーザーに、以下のコードを貼り付けたことを伝えます。私ができることについて何か提案はありますか?それは私の「OR」か「AND」か
if(((f_name <> null) or (f_name <> "")) or ((l_name <> null) or (l_name <> "")) or ((username <> null) or (username <> "")) or ((password <> null) or (password <> ""))) then
'response.redirect("account_created.asp")
response.write("You have not filled in all fields.")
else
Set objConn = ConnectDB()
query = "INSERT INTO [user] (username,[password],f_name,l_name) VALUES ('"& username &"','"& password &"','"& f_name &"','"& l_name &"')"
Set objs = objConn.Execute(query)
response.write(query)
'Response.Redirect ("thankyou.asp")
end if