how to login with different type of users ?

I have a table in sql server that contain username , usertype, password
how to making different login type and redirect to different pages ??
any suggestions  ?? any sample code ?? please !!

thx thx !!
Mike
mmccyAsked:
Who is Participating?
 
PluckaCommented:
mmccy,

<cfquery name="getUser">
    select  *
    from    UserTable
    where   UserName = '#form.UserName#'
</cfquery>

<cfswitch expression="#getUser.UserType#">
    <cfcase value="Admin">
        <cflocation url="AdminPage.cfm" />
    </cfcase>
    <cfcase value="Normal">
        <cflocation url="NormalPage.cfm" />
    </cfcase>
    <cfdefaultcase>
        <cflocation url="Logout.cfm" />
    </cfdefaultcase>
</cfswitch>

If several types go to the one page, you can use a comma seperated list. This is much cleaner than if elseif constructs.
<cfcase value="Normal,Admin">

Regards
Plucka
0
 
javasharpCommented:
Create an intermediate file to redirect to appropriate file based on the user type. like,

<cfif #GetUserDetails.usertype# eq 'Admin'>
  <cflocation url="admin_user_page.cfm">
<cfelse>
  <cflocation url="general_user_page.cfm">
</cfif>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.