CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Using LIKE function in ASP to redirect a group of UserIDs

Print topic Send  topic

Author Message
tcloud

Posts: 3
Posted: 03/18/2008, 10:10 AM

Simple question....

I have some customcode in the Before Show of a asp page that looks at the USERID of the logged in user to determine if said user should be redirected.... I am looking to reduce the code to simply check if the CCGetUserID() contains "-10"... I can't seem to find the syntax to do this.

My existing code looks like this (and it works fine this way... just looking to reduce code)

If CCGetUserID()="0464-10" then
Response.redirect "Master_list_Ral.asp"
ElseIf CCGetUserID()="0552-10" then
Response.redirect "Master_list_Ral.asp"
ElseIf CCGetUserID()="0664-10" then
Response.redirect "Master_list_Ral.asp"
ElseIf CCGetUserID()="0670-10" then
Response.redirect "Master_list_Ral.asp"
ElseIf CCGetUserID()="0674-10" then
Response.redirect "Master_list_Ral.asp"
ElseIf CCGetUserID()="0739-10" then
Response.redirect "Master_list_Ral.asp"
ElseIf CCGetUserID()="" then
Response.redirect "Login.asp"
End if

Any help would be appreciated

tc
View profile  Send private message
wkempees
Posted: 03/18/2008, 1:54 PM

VB:
  
If Right(CCGetUserID(),3))="-10" then  
   Response.redirect "Master_list_Ral.asp"  
Else If CCGetUserID()="" then  
  Response.redirect "Login.asp"  
End if  

Funny thing is I think it is only an extract of a more complex piece of
code.
If not, then why not:

  
If CCGetUserID()="" then  
  Response.redirect "Login.asp"  
Else  
   Response.redirect "Master_list_Ral.asp"  
End if  

(very very small lol)

Walter

wkempees
Posted: 03/18/2008, 2:50 PM

typo, sorry

"tcloud" <tcloud@forum.codecharge> schreef in bericht
news:647e040f4d183f@news.codecharge.com...
> that was it!... except for the extra ")" after the 3.... thanks a bunch,
> Walter
>
> tc
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

tcloud

Posts: 3
Posted: 03/18/2008, 3:06 PM

you are right... it is only a small piece of the bigger puzzle....

but what I am looking for is a way to cut down on the lines of code....

I'm looking for the exact syntax put in one statement that would redirect any users with a -10 at the end of their UserID.
View profile  Send private message
wkempees


Posts: 1679
Posted: 03/18/2008, 3:13 PM

I put it in there first block of code, VB example.
Search your language docs for right()

Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
tcloud

Posts: 3
Posted: 03/18/2008, 3:23 PM

that was it!... except for the extra ")" after the 3.... thanks a bunch, Walter

tc
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.