Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - make string not case sensitive
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

make string not case sensitive

 Post Reply Post Reply
Author
JoXser View Drop Down
Newbie
Newbie


Joined: 04 November 2001
Location: Canada
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote JoXser Quote  Post ReplyReply Direct Link To This Post Topic: make string not case sensitive
    Posted: 03 April 2003 at 12:40pm

Is there a way to make this code NOT case sensitive?

this simply checks a string but it is currently case sensitive how to make it NOT?

  If InStr(logon, "username") Then

Thanks
JxR

Entire code:
<%
  If InStr(logon, "username") Then

   Else
   Response.Redirect("http://www.site.com/page.asp")
     
                End If
%>



Edited by JoXser
Back to Top
eagle00789 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 24 March 2003
Location: Netherlands
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote eagle00789 Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2003 at 3:00pm

make it all lowercase.

put the example below in an empty asppage and upload it to your server. then do a request for that file, like
test.asp?Text=ThIs_Is_A_tEsT

'---------------- begin test.asp

<html>
<body>
<% = LCase(Request.QueryString("Text")) %>
</body>
</html>

'---------------- end test.asp

you'r code would be like

<%
  If InStr(logon, LCase("username")) Then

   Else
   Response.Redirect("http://www.site.com/page.asp")
     
                End If
%>

Greetings chris



Edited by eagle00789
Using forum at Gravenrode and here and here
Back to Top
JoXser View Drop Down
Newbie
Newbie


Joined: 04 November 2001
Location: Canada
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote JoXser Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2003 at 4:01pm

Thanks, but I don't think this will work as I need to check for user names (logon) & if a user enters in all caps then the above LCase will not work how you have it.

So it is if login = user or USER then

The above has the LCase in the wrong spot. will it work if LCase is in front of logon:

  If InStr(LCase(logon), "username") Then

JxR

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2003 at 6:22pm
http://www.devguru.com/Technologies/vbscript/quickref/instr.html

use the optional parameters to ignore case
Contribute to the working anarchy we fondly call the Internet
Back to Top
JoXser View Drop Down
Newbie
Newbie


Joined: 04 November 2001
Location: Canada
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote JoXser Quote  Post ReplyReply Direct Link To This Post Posted: 04 April 2003 at 7:28am

Yes, this is what i need to use.

so my code is now?:

<% =InStr(1, "logon", "username", VBTextCompare) %>

Thanks.
JxR

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.