how to display the username who already login

Results 1 to 2 of 2

Thread: how to display the username who already login

  1. #1
    grass Guest

    Default how to display the username who already login

    In my program, I have a form that let register user enter<BR>of course I need to varify their information.After Varify their information, I wnat to display "welcome username"<BR>But the username can be display <BR>why?<BR>and how to display?

  2. #2
    Join Date
    Dec 1969

    Default RE: how to display the username who already login

    Hey grass - presumambly youre getting the username from a database after they enter their password - so your recordset will have a username field in it something like rs("username").<BR>all you need to do is use a<BR>response.write "Welcome " & rs("username")<BR>you could also use a session variable so the user could be named throughout the rest of the site so <BR>session("username")= rs("username")<BR>and then response.write "Welcome " & session("username") <BR>would do the same.<BR><BR>So when the user logs in call a script login.asp which checks the database - this script should just be pure code which doesnt write any HTML if the user is correct then set the session variable and do a reponse.redirect ("welcome.asp")<BR>else<BR>response.redirect("wron gpassword.asp")<BR>but remember the login.asp script should have no HTML so just write a page like<BR>&#060;%<BR><BR>open recordset ..<BR>checkpassword...<BR>set session("user") if correct<BR>redirect("welcome") or incorrect<BR>close recordset etc<BR><BR>%&#062;<BR><BR>and save this file as login.asp<BR><BR>

Posting Permissions

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