Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Same ASP question made easier....
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Same ASP question made easier....

 Post Reply Post Reply
Author
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Topic: Same ASP question made easier....
    Posted: 07 March 2003 at 6:32pm
Ok, this is the code i'm using right now:

If Not intGroupIDInfo = 3 And Not intGroupIDInfo = 7 Then Response.Redirect "insufficient_permission.asp"

What I want to do is include the 3 and the 7 in a single variable (and be able to add more numbers to the var), to be able to add as many numbers (which are user groups) as i want without having to comparison line... Any suggestions are greatly appreciated.

Fernan
Back to Top
boyohboy View Drop Down
Groupie
Groupie


Joined: 15 October 2002
Location: United States
Status: Offline
Points: 197
Post Options Post Options   Thanks (0) Thanks(0)   Quote boyohboy Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2003 at 6:49pm

well, several ways you can do:

store 3,7,8,#,... in a string or a db field (later assign to a strVar), which are all SINGLE VARIABLE. When you check, do

Instr(intgroupid, storedstring)



Edited by boyohboy
Visit my community website @
EverythingVIET.com
Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2003 at 7:02pm
Sorry man.....i still don't get it....please have in mind this is my first time coding asp so i got strVar = "3,7,8" how do i compare them to intGroupID?

Thanks in advance...
Back to Top
boyohboy View Drop Down
Groupie
Groupie


Joined: 15 October 2002
Location: United States
Status: Offline
Points: 197
Post Options Post Options   Thanks (0) Thanks(0)   Quote boyohboy Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2003 at 7:15pm

ok, intGroupIDinfo always has "3" or "7", "4" or any number, correct?
And, you have stringVariable = "3,6,7,8"  and you may add more anytime, correct?

Use

If InStr(stringVariable, CStr(intGroupIDinfo)) <> 0 Then  'case found

the function will look into stringVariable for intGroupIDinfo. As soon as it find 3 or 7 exist in the string "3,6,7,8" it will return a non-Zero (ie the position of the found character). Then, you  can do whatever you want.



Edited by boyohboy
Visit my community website @
EverythingVIET.com
Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2003 at 7:50pm
Thanks a lot boyohboy!!!
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.