how to login with different type of users ?

Posted on 2006-03-26
Last Modified: 2013-12-24
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 !!
Question by:mmccy
    LVL 6

    Expert Comment

    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">
      <cflocation url="general_user_page.cfm">
    LVL 18

    Accepted Solution


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

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

    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">


    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    file too large for website 6 61
    Website Test Question 6 93
    Google Crawl Errors Producing 404 Errors 4 69
    Reverse Proxy Server 6 59
    In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
    When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    745 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

    16 Experts available now in Live!

    Get 1:1 Help Now