PageRenderTime 25ms CodeModel.GetById 16ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/default.asp

http://github.com/khaneh/Orders
ASP | 125 lines | 116 code | 5 blank | 4 comment | 18 complexity | 17eef1ac4881dac672061e8652b8806d MD5 | raw file
  1<%
  2response.buffer = true
  3'server.transfer "beta/login.asp"
  4response.redirect "beta"
  5function sqlSafe (s)
  6  st=s
  7  st=replace(St,"'","`")
  8  st=replace(St,chr(34),"`")
  9  sqlSafe=st
 10end function
 11%>
 12<HTML>
 13<HEAD>
 14<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
 15<meta http-equiv="Content-Language" content="fa">
 16<style>
 17	Table { font-size: 10pt;}
 18</style>
 19<TITLE>Login </TITLE>
 20<SCRIPT LANGUAGE="JavaScript">
 21<!--
 22var tempKeyBuffer;
 23function myKeyDownHandler(){
 24	tempKeyBuffer=window.event.keyCode;
 25}
 26function myKeyPressHandler(){
 27//	alert (tempKeyBuffer)
 28	if (tempKeyBuffer>=65 && tempKeyBuffer<=90){
 29		window.event.keyCode=tempKeyBuffer+32;
 30	}
 31	else if(tempKeyBuffer==186){
 32		window.event.keyCode=59;
 33	}
 34	else if(tempKeyBuffer==188){
 35		window.event.keyCode=44;
 36	}
 37	else if(tempKeyBuffer==190){
 38		window.event.keyCode=46;
 39	}
 40	else if(tempKeyBuffer==191){
 41		window.event.keyCode=47;
 42	}
 43	else if(tempKeyBuffer==192){
 44		window.event.keyCode=96;
 45	}
 46	else if(tempKeyBuffer>=219 && tempKeyBuffer<=221){
 47		window.event.keyCode=tempKeyBuffer-128;
 48	}
 49	else if(tempKeyBuffer==222){
 50		window.event.keyCode=39;
 51	}
 52}
 53//-->
 54</SCRIPT>
 55</HEAD>
 56
 57<BODY onLoad="document.all.UserName.focus();">
 58
 59<font face="tahoma">
 60<FORM METHOD=POST ACTION="default.asp">
 61<div dir='rtl' align = "center" >
 62<!--IMG SRC="images/khaneh.jpg" WIDTH="350" HEIGHT="20" BORDER=0 ALT=""-->
 63
 64<TABLE>
 65<TR>
 66	<TD colspan="2" align="center"></TD>
 67</TR>
 68<TR>
 69	<TD> ��� ����� </TD>
 70	<TD><INPUT TYPE="text" NAME="UserName" onkeyDown="return myKeyDownHandler();" onKeyPress="return myKeyPressHandler();"></TD>
 71</TR>
 72<TR>
 73	<TD> ��� ���� </TD>
 74	<TD><INPUT TYPE="password" NAME="Password" onkeyDown="return myKeyDownHandler();" onKeyPress="return myKeyPressHandler();"></TD>
 75</TR>
 76<TR>
 77	<TD></TD>
 78	<TD><INPUT style="font-family:tahoma; width:100%;" TYPE="submit" name="act" value="����"></TD>
 79</TR>
 80</TABLE>
 81 <br>
 82&nbsp; 
 83<br>
 84<hr>
 85</div>
 86</FORM>
 87<br>
 88<%
 89if request("act")="����" then
 90'	conStr="dsn=sefareshat; uid=sefadmin; pwd=5tgb; DATABASE=sefareshat"
 91	'	conStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("kid.mdb")
 92    conStr = "Provider=SQLNCLI10.1;Persist Security Info=False;User ID=sefadmin;Initial Catalog=sefareshat;Data Source=(local);PWD=5tgb;"
 93    Set conn = Server.CreateObject("ADODB.Connection")
 94	conn.open conStr
 95'	conn.Execute ("DELETE FROM Temp_Moein")
 96    
 97    Set RS1 = conn.Execute("SELECT * FROM [tblCSR] WHERE [UserName]='" & sqlSafe(request("UserName")) & "' AND  [Password]='" & sqlSafe(request("Password")) & "' ")
 98    If (RS1.EOF) Then
 99		session.abandon
100	%>
101		<TABLE border='1' width='70%' align='center' cellpadding='10' >
102		<TR>
103			<td align='center' dir='rtl' bgcolor='#FF8888'>Login Incorrect&nbsp;</td>
104		</TR>
105		</TABLE>
106	<%else
107		session("ID")=RS1("CSRID")
108		conn.Close
109		response.redirect "search.asp"
110    End If
111
112	conn.Close
113elseif request.querystring("err")<>"" then 
114%>
115		<TABLE border='1' width='70%' align='center' cellpadding='10' >
116		<TR>
117			<td align='center' dir='rtl' bgcolor='#FF8888'><%=request.querystring("err")%>&nbsp;</td>
118		</TR>
119		</TABLE>
120<%
121end if
122%>
123</font>
124</BODY>
125</HTML>