Contents of functions.inc
<%
function Capitalized( cString)
dim head, neck, body, aStrings, hyphos
aStrings = split( cString)
for i = 0 to ubound( aStrings)
aStrings( i) = ucase( left ( aStrings( i), 1)) & lcase( mid( aStrings( i), 2))
hyphos = instr( aStrings( i), "-")
if hyphos > 0 then
head = left( aStrings( i), hyphos)
neck = ucase( mid( aStrings( i), hyphos + 1, 1))
body = right( aStrings( i), len( aStrings( i)) - hyphos - 1)
aStrings( i) = head + neck + body
end if
next
Capitalized = join( aStrings)
end function
function Blank_Fields()
Blank_Fields = False
For each i in request.form
if trim( request.form(i)) = "" then
Blank_Fields = true
exit function
end If
next
end function
function invalidPass()
if len( trim( request.form( "password"))) < 5 or _
len( trim( request.form( "password"))) > 8 then
response.redirect( "Messages.asp?Msg=badPwd")
'response.write( "<h2>Processing halted!</h2>")
'strMsg = "Password must be between 5 an 8 characters long inclusive." &"<br>"
'strMsg = strMsg + "Use the Back button to return."
'response.write( strMsg)
'response.end
end if
end function
'There must be an easier way than the following for translating escape codes...
function escaPunct( code)
escaPunct = ""
select case ucase( code)
case "%7E"
escaPunct = "~"
case "%21"
escaPunct = "!"
case "%23"
escaPunct = "#"
case "%24"
escaPunct = "$"
case "%25"
escaPunct = "%"
case "%5E"
escaPunct = "^"
case "%26"
escaPunct = "&"
case "%28"
escaPunct = "("
case "%29"
escaPunct = ")"
case "%3A"
escaPunct = ":"
case "%3B"
escaPunct = ";"
case "%22"
escaPunct = chr(34)
case "%27"
escaPunct = chr(39)
case "%3F"
escaPunct = "?"
case "%2F"
escaPunct = "/"
case "%3C"
escaPunct = "<"
case "%3E"
escaPunct = ">"
case "%2C"
escaPunct = ","
case "%7B"
escaPunct = "{"
case "%7D"
escaPunct = "}"
case "%5B"
escaPunct = "["
case "%5D"
escaPunct = "]"
case "%7C"
escaPunct = "|"
case "%5C"
escaPunct = "\"
case else
escaPunct = ""
end select
end function
%>