Forum » Izdelava spletišč » Ob prijavi vpiše datum
Ob prijavi vpiše datum
tomazm ::
Rad bi da mi ob prijavi na stran v accessovo bazo podatkov vpiše datum prijave. V bazi sem naredil stopec prijava, na default strani pa
<form action="validate.asp" method="Post">
<input type="hidden" name="prijava" value="<%=Date()%>" size="20">
Zdaj pa ne vem kako naj to na strani validata.asp to rešim da bo zapisalo v bazo!
Koda te strani je:
<%@Language=VBScript%>
<%Response.Buffer = True%>
<!--#INCLUDE FILE="config.inc"-->
<html>
<body>
<%
UserName = Replace(Trim(Request.Form("username")), "'", "''")
PassWord = Replace(Trim(Request.Form("password")), "'", "''")
If UserName = "" OR PassWord = "" Then Response.Redirect "default.asp"
SQL = "Select ID, UserName, [PassWord], Clearance, ExpireDate From Login"
Set RS = MyConn.Execute(SQL)
While Not RS.EOF
If UserName = RS("UserName") And PassWord = RS("Password") Then
If RS("ExpireDate") > Now() Then
Session("allow") = True
Session("clearance") = RS("Clearance")
Level = RS("Clearance")
Else
Response.Redirect "utility.asp?method=expired"
End If
End If
RS.MoveNext
Wend
CleanUp(RS)
If Session("allow") = True Then
If Level = 3 Then Response.Redirect "x.asp"
If Level < 3 Then Response.Redirect "y.asp"
Else
Response.Redirect "default.asp"
End If
%>
<%
Dim id, username, password, level, expdate
SQL = "Update Login Set UserName = '"&username&"', [PassWord] = '"&password&"'"
SQL = SQL & ", Clearance = "&level&", ExpireDate = '"&expdate&"' Where ID = "&id&""
Set RS = MyConn.Execute(SQL)
CleanUp2()
Response.Redirect "admin.asp"
%>
<form action="validate.asp" method="Post">
<input type="hidden" name="prijava" value="<%=Date()%>" size="20">
Zdaj pa ne vem kako naj to na strani validata.asp to rešim da bo zapisalo v bazo!
Koda te strani je:
<%@Language=VBScript%>
<%Response.Buffer = True%>
<!--#INCLUDE FILE="config.inc"-->
<html>
<body>
<%
UserName = Replace(Trim(Request.Form("username")), "'", "''")
PassWord = Replace(Trim(Request.Form("password")), "'", "''")
If UserName = "" OR PassWord = "" Then Response.Redirect "default.asp"
SQL = "Select ID, UserName, [PassWord], Clearance, ExpireDate From Login"
Set RS = MyConn.Execute(SQL)
While Not RS.EOF
If UserName = RS("UserName") And PassWord = RS("Password") Then
If RS("ExpireDate") > Now() Then
Session("allow") = True
Session("clearance") = RS("Clearance")
Level = RS("Clearance")
Else
Response.Redirect "utility.asp?method=expired"
End If
End If
RS.MoveNext
Wend
CleanUp(RS)
If Session("allow") = True Then
If Level = 3 Then Response.Redirect "x.asp"
If Level < 3 Then Response.Redirect "y.asp"
Else
Response.Redirect "default.asp"
End If
%>
<%
Dim id, username, password, level, expdate
SQL = "Update Login Set UserName = '"&username&"', [PassWord] = '"&password&"'"
SQL = SQL & ", Clearance = "&level&", ExpireDate = '"&expdate&"' Where ID = "&id&""
Set RS = MyConn.Execute(SQL)
CleanUp2()
Response.Redirect "admin.asp"
%>
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | [ASP.NET] Prenos podatkov iz ene spletne strani v drugoOddelek: Programiranje | 935 (794) | Cvenemir |
» | ASP.NET (C#) - PomočOddelek: Izdelava spletišč | 1118 (895) | Denisj |
» | [ ASP.NET ] Vprašanje glede podajanja parametrovOddelek: Programiranje | 1563 (1294) | salesky |
» | Javascript vprašanjeOddelek: Izdelava spletišč | 1128 (1042) | zigi |
» | ASP- prenašanje vrednostiOddelek: Izdelava spletišč | 1357 (1192) | Microsoft |