[login.asp]
<%
username = Request.Cookies("Sec")("username") ' Veriyi alalım
userpass = Request.Cookies("Sec")("userpass")
%>
[security.asp]
<%
username = Request.QueryString("username")
userpass = Request.QueryString("userpass")
if username = "deneme" And userpass = "deneme" Then
Response.Cookies("Sec")("username") = username
Response.Cookies("Sec")("userpass") = userpass
Response.Redirect ("main.asp")
elseif username = "deneme" And userpass = "123456" Then
Response.Cookies("Sec")("username") = username
Response.Cookies("Sec")("userpass") = userpass
Response.Redirect ("main.asp")
elseif username = "deneme" And userpass = "456" Then
Response.Cookies("Sec")("username") = username
Response.Cookies("Sec")("userpass") = userpass
Response.Redirect ("main.asp")
else
Response.Redirect ("login.asp")
end if
%>
[main.asp]
<%
username = Request.Cookies("Sec")("username") ' Veriyi alalım
userpass = Request.Cookies("Sec")("userpass")
if username <> "" then ' Eğer daha önce veri girilmişse....
%>
Merhaba:<%=username%>
<%
else ' Eğer daha önce çerez kaydedilmedi ise
Response.Redirect ("login.asp")
%>
<% end if %>
|