/ Forside / Teknologi / Udvikling / ASP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
ASP
#NavnPoint
smorch 9259
Harlekin 1866
molokyle 1040
Steffanst.. 758
gandalf 657
smilly 564
gibson 560
cumano 530
MouseKeep.. 480
10  Random 410
hvordan gør man liiige det her?????
Fra : Jensen


Dato : 28-01-01 17:41

Nu har jeg snart siddet i laaaang tid og gloet på det her....og nu kommer
jeg ikke længere
Det her skulle være et login script


----------------------------------------------------
<%@ Language="vbscript"%>
<!--#include file="dataconn.asp"-->
<%
Dim UserName
Dim Password
UserName = Request.Form("Username")
Password = Request.Form("Password")

If Len(UserName) > 0 Then
msql = ("SELECT Domain, Name FROM Users WHERE Domain='" & UserName & "' AND
Name='" & Password & "'")
Set RS = Conn.Execute(msql)

If RS.EOF Then
ErrorMessage = "<P><font color=""black"">Invalid Username or
Password</font></P>"

RS.Close
Set RS = Nothing
Set Conn = Nothing
Else
' This is the encrypted value
Session("SecurityID") = "ôåóô"
Response.redirect "edit_UpRec.asp"
End If
End If
%>

-------------------------------------------------

Hvordan får jeg usernamet ind som betingelse for select kommandoen i denne
update del det der sker nu er at den hiver alle de poster frem hvor der ikke
er noget domain tilknyttet.....(fikst men ikke lige meningen)


-----------------------------------------------------------------------

<%@ Language="vbscript"%>
<!--Connection to the DB-->
<!--#include file="dataconn.asp"-->
<%If Request.Querystring("record") = "" and
Request.ServerVariables("REQUEST_METHOD")<>"post" Then%>
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY bgColor="#FFFFFF" Background="">
<Center><H1><Font Color="#000000">Mail Admin for</Font></H1></Center>

<%
Dim UserName
Dim Password
UserName = Request.Form("Username")
Password = Request.Form("Password")




msql = ("SELECT Id, Alias, Domain, Password, Name, Mailbox FROM Users WHERE
Domain='" & UserName & "'")
Set RS=Conn.Execute(msql)
%>

<Table border="1" cellpadding="2" cellspacing="2" Align="Center"
borderColor="#000000" Background="" >
<TR><TD><Font Face="Verdena" Color="#9F0042">Accounts</Font></TD>
<TD><Font Face="Verdena" Color="#000000">Id</Font></TD>
<TD><Font Face="Verdena" Color="#000000">Alias</Font></TD>
<TD><Font Face="Verdena" Color="#000000">Domain</Font></TD>
<TD><Font Face="Verdena" Color="#000000">Password</Font></TD>
<TD><Font Face="Verdena" Color="#000000">Name</Font></TD>
<TD><Font Face="Verdena" Color="#000000">Mailbox</Font></TD>
</TR>

<%
Dim x
x = 0
Do While Not RS.EOF
x = x + 1
%>

<TR>
<TD><a href='edit_UpRec.asp?record=<%=RS("Id")%>'><%response.write
(x)%></a></TD>
<TD><Font Face="Verdena" Color="#000000"><%=RS("Id")%></TD></Font>
<TD><Font Face="Verdena" Color="#000000"><%=RS("Alias")%></TD></Font>
<TD><Font Face="Verdena" Color="#000000"><%=RS("Domain")%></TD></Font>
<TD><Font Face="Verdena" Color="#000000"><%=RS("Password")%></TD></Font>
<TD><Font Face="Verdena" Color="#000000"><%=RS("Name")%></TD></Font>
<TD><Font Face="Verdena" Color="#000000"><%=RS("Mailbox")%></TD></Font>
</TR>
<%

RS.MoveNext
Loop
RS.Close
Conn.Close
Set RS = Nothing
%>

</TABLE>
<%

Else
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then

Conn.Execute ("UPDATE Users SET Users.Id='" & Request.Form("Id") & "' WHERE
Users.Id=" & Request.QueryString("record") & ";")
Conn.Execute ("UPDATE Users SET Users.Alias='" & Request.Form("Alias") & "'
WHERE Users.Id=" & Request.QueryString("record") & ";")
Conn.Execute ("UPDATE Users SET Users.Domain='" & Request.Form("Domain") &
"' WHERE Users.Id=" & Request.QueryString("record") & ";")
Conn.Execute ("UPDATE Users SET Users.Password='" & Request.Form("Password")
& "' WHERE Users.Id=" & Request.QueryString("record") & ";")
Conn.Execute ("UPDATE Users SET Users.Name='" & Request.Form("Name") & "'
WHERE Users.Id=" & Request.QueryString("record") & ";")
Conn.Execute ("UPDATE Users SET Users.Mailbox='" & Request.Form("Mailbox") &
"' WHERE Users.Id=" & Request.QueryString("record") & ";")
Conn.Close
Response.Write ("Thank you for your changes.")
Else
msql = "SELECT * FROM [Users] where Users.Id=" &
Request.Quer

 
 
Søg
Reklame
Statistik
Spørgsmål : 177557
Tips : 31968
Nyheder : 719565
Indlæg : 6408868
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste