Ask a Question related to ASP, Design and Development.
-
Treize13 #1
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
-
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... -
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... -
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... -
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... -
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 : ... -
2clip webforumsuser@macromedia.com #2
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
-
John Davis #3
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
-
PB4FUN #4
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
-
gcmenotti #5
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
-
-
BKBK #7
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
-
gcmenotti #8
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
-
gcmenotti #9
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



Reply With Quote

