Ask a Question related to ASP, Design and Development.

  1. #1

    Default login question

    I would like to find how to create "Welcome" page after logged in. For
    example, when a person logged in and the page appears "Welcome. Mr.
    Ovington" with the personal display before access restrict page. I use MySQL
    connect with my host phpMyAdmin and php login suite program behavior in
    DWMX.

    This is reasons why do I need to create "welcome" because I need to protect
    users from sharing a password so their much less likely to share their
    password as they dont want anyone else being able to see their personal
    data.


    Treize13 Guest

  2. Similar Questions and Discussions

    1. PHP Login/Registration question
      Hey Everyone, I have a question regarding a registration and login for a website, I am a developing a website that needs to have the following...
    2. cfnewbie login and application.cfc question
      I'm just getting into coldfusion. I've been reading the live docs about using application.cfc to handle logins but I have some questions about my...
    3. DG-UX Question - Login Banner
      Hello All! A friend of mine is a system admin of a Solaris system and a DG Aviion Unix box. He was asked to implement a warning banner (login...
    4. ASP.Net Security login question
      I have an ASP.Net web form with a DataGrid on it... I want to programatcally display a Delete link column if the local NT user is a member of the...
    5. ASP Login question...
      fairly easy. just do an if statement based on the checkbox value. if the box is checked, set the cookie, bearing in mind this article : ...
  3. #2

    Default Re:login question

    DWMX works nicely for this. You need to apply the authenticate user > log in user server behavior. After logged in, it creates a session variable called MM_Username which you can then use in your SQL statement to filter the results for the unique user who's logged in.

    Norm


    2clip webforumsuser@macromedia.com Guest

  4. #3

    Default login question

    I put a little login (username and password textfields) in a web page, and
    once the user able to login, I want the username and password textfields
    will disappear, and replace with text "[UserName] has Login!]" in the same
    position.

    My question is how to make the username and password textfields disappear
    and replace with "[UserName] has Login!]" in the same position?
    This is the code I have done so far, but it has another problem: Even I
    first check if the length of username field is non-zero first, it still
    displays "Login Failed" before the user login. I guess it's the session
    problem but don't know how to fix it.

    <html>
    <head>
    <title>Login Form</title>
    </head>
    <body>
    <form action="login.asp" method="post">
    <table border="0">
    <tr>
    <td>User ID</td>
    <td><input type="text" name="username"></td>
    </tr>

    <tr>
    <td>Password</td>
    <td><input type="password" name="password"></td>
    </tr>
    </table>
    <input type="submit" value="submit">
    <input type="reset" value="reset">
    </form>


    <!-- #include file="dbConn.asp"-->
    <!-- METADATA TYPE="typelib"
    FILE="C:\Program Files\Common
    Files\System\ado\msado15.dll" -->


    <%
    If Len(Request.Form("username")) <> 0 Then
    Dim strusername, strpassword, sqlStmt, objRS
    strusername = Request.Form("username")
    strpassword = Request.Form("password")
    sqlStmt = "select * from [Password] where UserName = '" & strusername &
    "'" & _
    " And Password = " & "'" & strpassword & "'" & ";"
    Set objRS = Server.CreateObject("ADODB.RecordSet")
    objRS.Open sqlStmt, strConnect ', adOpenStatic, adLockReadOnly,
    adCmdTable
    If objRS.EOF Then
    Response.Write "Login Failed"
    Else
    Response.Write "Login Success: " & _
    "UserName = " & strusername & "," & _
    "Password = " & strpassword
    End If
    End If
    %>
    </body>
    </html>


    please advise! thanks!
    john





    John Davis Guest

  5. #4

    Default Re: login question

    Works fine here, only the text you want is not there.
    You Have this :
    Response.Write "Login Success: " & _
    "UserName = " & strusername & "," & _
    "Password = " & strpassword
    Seems you want to have this :
    Response.Write strUsername & " has login."
    Furthermore, you check the request.Form twice.
    Try this :
    strUsername = Trim(Request("Username"))
    If strUsername = "" Then
    'user did not fill in anything
    else
    'User did fill in something
    end if

    If you only check if the user has an account, so if there is a record
    containing the un and pw,
    try another query.
    Select Count(Username) From [Password] ..... etc.
    Now you allways have a record.
    If the user is in the db you will have objRS.Fields(0) = 1
    else objRS.Fields(0) will be 0
    Instead of adOpenStatic you can use adForwardOnly, is faster, and do not use
    the adCmdTable after it.

    Meindert, MCP
    > I put a little login (username and password textfields) in a web page, and
    > once the user able to login, I want the username and password textfields
    > will disappear, and replace with text "[UserName] has Login!]" in the same
    > position.
    >
    > My question is how to make the username and password textfields disappear
    > and replace with "[UserName] has Login!]" in the same position?
    > This is the code I have done so far, but it has another problem: Even I
    > first check if the length of username field is non-zero first, it still
    > displays "Login Failed" before the user login. I guess it's the session
    > problem but don't know how to fix it.
    >
    > <html>
    > <head>
    > <title>Login Form</title>
    > </head>
    > <body>
    > <form action="login.asp" method="post">
    > <table border="0">
    > <tr>
    > <td>User ID</td>
    > <td><input type="text" name="username"></td>
    > </tr>
    >
    > <tr>
    > <td>Password</td>
    > <td><input type="password" name="password"></td>
    > </tr>
    > </table>
    > <input type="submit" value="submit">
    > <input type="reset" value="reset">
    > </form>
    >
    >
    > <!-- #include file="dbConn.asp"-->
    > <!-- METADATA TYPE="typelib"
    > FILE="C:\Program Files\Common
    > Files\System\ado\msado15.dll" -->
    >
    >
    > <%
    > If Len(Request.Form("username")) <> 0 Then
    > Dim strusername, strpassword, sqlStmt, objRS
    > strusername = Request.Form("username")
    > strpassword = Request.Form("password")
    > sqlStmt = "select * from [Password] where UserName = '" & strusername
    &
    > "'" & _
    > " And Password = " & "'" & strpassword & "'" & ";"
    > Set objRS = Server.CreateObject("ADODB.RecordSet")
    > objRS.Open sqlStmt, strConnect ', adOpenStatic, adLockReadOnly,
    > adCmdTable
    > If objRS.EOF Then
    > Response.Write "Login Failed"
    > Else
    > Response.Write "Login Success: " & _
    > "UserName = " & strusername & "," & _
    > "Password = " & strpassword
    > End If
    > End If
    > %>
    > </body>
    > </html>
    >
    >
    > please advise! thanks!
    > john
    >
    >
    >
    >
    >

    PB4FUN Guest

  6. #5

    Default Login question

    Hi people please help
    when i enter the login and password in the Login.CFM
    i enter to Index.CFM and have some query that only work when i log on my page
    but when i click in the link Index2.CFM the querys doesnt work
    why this happend,
    please help me

    gcmenotti Guest

  7. #6

    Default Re: Login question

    if you can post some code it would be helpful
    AirJar Guest

  8. #7

    Default Re: Login question

    Every form on your site is going to have a Submit field, so it's inefficient
    to test for login credentials in Application.cfm using <cfif
    IsDefined('FORM.submit')>.
    That will run even when the "Wedding" form or the "Katmandu_Expedition" form
    is submitted. Better to use instead

    <cfif IsDefined('FORM.username') and IsDefined('FORM.password')>

    Even better, enable sessionmanagement, set loginStorage to "session" and
    enclose
    your login code with <cflogin>. The cflogintag will no longer run after
    cfloginuser is
    executed, until the end of the session or until <cflogout> is executed. This
    is one way

    <cflogin>
    <cfif IsDefined('FORM.username') and IsDefined('FORM.password')>
    CFQUERY NAME="qLogin" DATASOURCE="#m8#">
    SELECT NombreUsuario, Clave, IdUsuario, Fkcliente
    FROM dbo.ClientesMyAccount INNER JOIN dbo.Usuarios ON
    (dbo.ClientesMyAccount.Id_Cliente = dbo.Usuarios.FkCliente)
    WHERE dbo.Usuarios.IdUsuario = dbo.Usuarios.IdUsuario
    AND dbo.Usuarios.NombreUsuario = '#FORM.username#'
    AND dbo.Usuarios.Clave = '#FORM.password#'
    </cfquery>
    <cfif qLogin.RecordCount GT 0>
    <cfloginuser name="#qLogin.NombreUsuario#" password="#FORM.password#"
    roles="#qLogin.IdUsuario#">
    <cfelse>
    <cfset sHeaderMessage = "The email and password combination you tried is
    incorrect." >
    <cfinclude template="login.cfm" >
    <cfabort>
    </cfif>
    <cfelse>
    <cfinclude template="login.cfm">
    <cfabort>
    </cfif>
    </cflogin>



    BKBK Guest

  9. #8

    Default Re: Login question

    thx for the reply

    i try, i think is the best one
    but i still have problems when i click a link
    the querys doesnt work
    do i have to put a code in the other link?


    gcmenotti Guest

  10. #9

    Default Re: Login question

    i have this on index.cfm
    <cfif isDefined("qLogin.idusuario")>
    <CFQUERY NAME="cuenta" DATASOURCE="#m8#" result="myresult">
    SELECT TOP 100 Llamadas.NumeroOrigen, Llamadas.NumeroDestino,
    Llamadas.Starttime, Llamadas.Fecha, Llamadas.CostoLlamada, Llamadas.Codigo,
    Llamadas.Destino, Llamadas.Tarifa, Llamadas.FkCliente, Usuarios.FkCliente AS
    Expr1 FROM Llamadas INNER JOIN Usuarios ON Llamadas.FkCliente =
    Usuarios.FkCliente
    WHERE Usuarios.FkCliente = '#qlogin.fkcliente#'
    ORDER BY Llamadas.Fecha DESC
    </cfquery>
    </cfif>

    and when i click on index.cfm 2 link
    the querys doesnt work

    gcmenotti Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139