Solved

Compare 2 strings if string 2 has the same word in it do something

Posted on 2010-11-30
4
344 Views
Last Modified: 2013-01-20
Hello All;

I need to compare 2 string together and see if

str1 = "carrzkiss"
str2 = "iscarrzkissme"
if (str1 = str2) then
response.write"you cannot have your username in this string"
else
continue on
end if

Something like that.
This is for a password field, to keep people from reusing their username as part of their password.
0
Comment
Question by:Wayne Barron
  • 2
4 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 34236875
0
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 500 total points
ID: 34236891
yup, instr is fine. use lcase as well

if instr(lcase(str2), lcase(str1)) > 0 then
  ' there is a case insensitive match
0
 
LVL 30

Author Closing Comment

by:Wayne Barron
ID: 34237809
Thanks Cyber.
It was the lcase that I was missing.
0
 
LVL 30

Author Comment

by:Wayne Barron
ID: 38798933
I had not used this in a while, and had forgotten about how to use it.
So thankful that I had this to look back on.
Thanks once again cyberkiwi

Carrzkiss
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now