Posted: Sat Aug 21, 2010 10:32 pm Post subject: كمك در پروژه
من براي صفحه ي عضويت وب سايتي كه طراحي كردم به مشكل برخوردم.
كدها و شرط هاي asp براي صفحه ي عضويت و صفحه ي ورود كاربران رو مي خوام.
اگه در اين زمينه بهم كمكي كنيد ممنون ميشم.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><%Response.Buffer = True Function ValidateLogin( sId, sPwd ) ' For you to validate ID and PASSWORD ' Maybe against a database ' Here we have hardcoded some OK id:s and passwords ' ValidateLogin = False If sId = "anil_rash" AND sPwd="rashmi" Then ValidateLogin = True End If If sId = "user2" AND sPwd="pwd2" Then ValidateLogin = True End IfEnd Function Dim sText, fBack fBack = FalseIf Request.Form("dologin") = "yes" Then 'Try to login If ValidateLogin( Request.Form("id"),Request.Form("pwd") ) = True Then 'It is OK!!! 'We are logged in so lets go back to the file that included us fBack = True Session("logonid") = Request.Form("id") Else sText = "Wrong password or user id" End IfElse 'We are not trying to login... If Session("loginid") <> "" Then ' fBack = True 'We are logged in so lets go back to the file that included us Else sText = "Please login" End IfEnd If If fBack = False Then %><!--#include file="includelogin.asp"-->
<html>
<%=sText%>
<%
Dim sURL
sURL = Request.ServerVariables("SCRIPT_NAME")
If Request.ServerVariables("QUERY_STRING") <> "" Then
'
sURL = sURL & "?" & Request.ServerVariables("QUERY_STRING")
End If
%>
Function ValidateLogin( sId, sPwd )
' For you to validate ID and PASSWORD
' Maybe against a database
' Here we have hardcoded some OK id:s and passwords
'
ValidateLogin = False
If sId = "anil_rash" AND sPwd="rashmi" Then
ValidateLogin = True
End If
If sId = "user2" AND sPwd="pwd2" Then
ValidateLogin = True
End If
End Function
Dim sText, fBack
fBack = False
If Request.Form("dologin") = "yes" Then
'Try to login
If ValidateLogin( Request.Form("id"),Request.Form("pwd") ) = True Then
'It is OK!!!
'We are logged in so lets go back to the file that included us
fBack = True
Session("logonid") = Request.Form("id")
Else
sText = "Wrong password or user id"
End If
Else
'We are not trying to login...
If Session("loginid") <> "" Then
'
fBack = True
'We are logged in so lets go back to the file that included us
Else
sText = "Please login"
End If
End If
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum