www.webdeveloper.com
Results 1 to 4 of 4

Thread: Personal homepage with login form using POST?

  1. #1
    Join Date
    Mar 2006
    Posts
    113

    Personal homepage with login form using POST?

    I want to have it so a user logs in with a username and password, and then they are taken to a page that fills with links based on their userType. And it will say Hello, [username here].

    I'm kinda new at this. I've done Master/Detail pages using url variables, but I can't figure out how to send a user's info from the login page through to the next page using the login form and POST.

    Any help or links to a tutorial would be great.

  2. #2
    Join Date
    Jun 2006
    Posts
    263

    passing ASP values with post method

    To transfer information to another page using ASP is quite simple. Say the username field on the login page was named "username" then to carry the value onto the home page you would write:

    <%username = Request.Form("username")%>

    <h3>Hello <%=username%> !</h3>

  3. #3
    Join Date
    Mar 2006
    Posts
    113

    how to tackle the links part??

    Thanks for the quick response.

    Is there anyway to then populate the Hello page with dynamic content based on the user's userType?

    Example: if a user is a student they get certain links on the page, if the user logging in is a teacher, they get those same links, but a few more that the student userType shouldn't see.

  4. #4
    Join Date
    Jun 2004
    Location
    Kansas City, MO
    Posts
    1,607
    on the page in question you could do something like this

    Code:
    Select Case userType
          Case "Student"
                 sSQL = "SELECT * FROM LINKS WHERE userType = 'Student'"
    
          Case "Teacher"
                 sSQL = "SELECT * FROM LINKS WHERE userType = Teacher"
    
          Case else
              Response.write "Unable to locate links. userType is not defined"
    End Select

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles