Hmm Works ok for me with hardcoded values, possibly there are spaces being added in the CSV that is throwing it off. Such as if you concatenate the string with ", " (or similar) for ease of reading in the DB fields.
This would add a leading space to each name except the first one.
If that is the case;
Code:
function CheckUser(username,allowed)
dim usernames,i
usernames = trim(split(allowed,","))
CheckUser = false
for i = 0 to ubound(usernames)
if lcase(trim(username)) = lcase(usernames(i)) then
CheckUser = true
exit for
end if
next
end function
should work.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|