Bu kodlar sayesinde istediğiniz sayfalara şifresiz girilmesini engelliyebilirsiniz.Sadece bu kodları sifre.asp olarak kaydediyoruz ve şifrelenecek sayfalara
"<!--#include file="sifre.asp"--> yöntemi ile ekliyoruz
<%
logstatus=request.QueryString("logadm")
if logstatus="true" then
session("user_admin")=""
session.Contents.RemoveAll()
session.Abandon()
'response.Redirect("Cikistamamlaninca yonlenecek sayfa")
end if
action=request.form("action")
if action="login" then
kullanici=trim(request.Form("kullanici"))
sifre=trim(request.Form("sifre"))
if kullanici="lugelas" AND sifre="lugelas" then
session.Timeout=180
session("user_admin")="admin"
response.Redirect("giristamam.asp")
else
error_msg="Yanlış kullanıcı veya şifre"
end if
end if
%>
<html>
<head>
<title>Admin giris</title>
<**** **********="Content-Type" content="text/html; charset=windows-1254">
</head>
<body>
<p> </p>
<p> </p>
<form action="default.asp" method="post" name="giris" target="_top" id="giris" >
<table width="256" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FF0099">
<tr>
<td>
<table width="254" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr>
<td colspan="2"><div align="center"><font color="#990000"><%=error_msg%> </font></div></td>
</tr>
<tr>
<td width="95">Kullanıcı</td>
<td width="305"><input name="kullanici" type="text" id="kullanici" size="19" maxlength="20" style="width:100"></td>
</tr>
<tr>
<td>Şifre</td>
<td><input name="sifre" type="password" id="sifre" size="20" maxlength="20" style="width:100"></td>
</tr>
<tr>
<td> </td>
<td><input name="Submit" type="submit" class="submit" value="Giriş">
<input name="action" type="hidden" id="action" value="login"></td>
</tr>
</table>
</td></tr></table>
</form>
</body>
</html>
----------------
Bu kodlar ile istediğiniz sayfayı ziyaretçinizin arkadaşına tavsiye etmesini sağlayabilirsiniz.
<H3>Tavsiye </H3>
<%
Dim objCDONTS
Dim strFromName
Dim strFromEmail, strToEmail
Dim strSubject, strBody
Dim strThisPage
Dim strReferringPage
Dim bValidInput
strThisPage = Request.ServerVariables("SCRIPT_NAME")
strReferringPage = Request.ServerVariables("HTTP_REFERER")
' Debugging lines:
'Response.Write strThisPage & "<BR>" & vbCrLf
'Response.Write strReferringPage & "<BR>" & vbCrLf
' Read in and set the initial values of our message parameters
strFromName = Trim(Request.Form("txtFromName"))
strFromEmail = Trim(Request.Form("txtFromEmail"))
strToEmail = Trim(Request.Form("txtToEmail"))
strSubject = "Check out ASP 101!"
strBody = Trim(Request.Form("txtMessage"))
' I set the body message to a message that referenced the page the
' user arrived from. This makes it great if you place a link to it
' from your different articles, but can be weird if people link in
' from other web sites.
If strBody = "" Then
If strReferringPage = "" Or InStr(1, strReferringPage, "www.prowww.net", 1) = 0 Then
strBody = ""
strBody = strBody & "Bu site harika bir site.Mutlaka gez..." & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & " http://www.prowww.net" & vbCrLf
Else
strBody = ""
strBody = strBody & "Bu siteyi mutlaka gezmelisin" & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & " " & strReferringPage & vbCrLf
End If
End If
' Quick validation just to make sure our parameters are somewhat valid
bValidInput = True
bValidInput = bValidInput And strFromName <> ""
bValidInput = bValidInput And IsValidEmail(strFromEmail)
bValidInput = bValidInput And IsValidEmail(strToEmail)
' If valid send email and show thanks, o/w show form
If bValidInput Then
' Set up our email object and send the message
Set objCDONTS = Server.CreateObject("CDONTS.NewMail")
objCDONTS.From = strFromName & " <" & strFromEmail & ">"
objCDONTS.To = strToEmail
objCDONTS.Subject = strSubject
objCDONTS.Body = strBody
objCDONTS.Send
Set objCDONTS = Nothing
' Show our thank you message
ShowThanksMsg
Else
If "http://" & Request.ServerVariables("HTTP_HOST") & strThisPage = strReferringPage Then
Response.Write "Lutfen bos alan birakmayin.Mail adreslerini dogru yazin" & "<BR>" & vbCrLf
End If
' Show our information retrieval form
ShowReferralForm strThisPage, strFromName, strFromEmail, strToEmail, strBody
End If
' End of page logic... subs and functions follow!
%>
<%
' Subroutines and Functions that encapsulate some functionality
' and make the above code easier to write... and read.
' A quick email syntax checker. It's not perfect,
' but it's quick and easy and will catch most of
' the bad addresses than people type in.
Function IsValidEmail(strEmail)
Dim bIsValid
bIsValid = True
If Len(strEmail) < 5 Then
bIsValid = False
Else
If Instr(1, strEmail, " ") <> 0 Then
bIsValid = False
Else
If InStr(1, strEmail, "@", 1) < 2 Then
bIsValid = False
Else
If InStrRev(strEmail, ".") < InStr(1, strEmail, "@", 1) + 2 Then
bIsValid = False
End If
End If
End If
End If
IsValidEmail = bIsValid
End Function
' I made this a function just to get it out of the
' logic and make it easier to read. It just shows the
' form that asks for the input
Sub ShowReferralForm(strPageName, strFromName, strFromEmail, strToEmail, strBody)
' I use script_name so users can rename this script witout having to change the code.
%>
<FORM ACTION="<%= strPageName %>" METHOD="post" name=frmReferral>
<TABLE BORDER="0">
<TR>
<TD VALIGN="top" ALIGN="right"><STRONG>Adiniz:</STRONG></TD>
<TD><INPUT TYPE="text" NAME="txtFromName" VALUE="" SIZE="30"></TD>
</TR>
<TR>
<TD VALIGN="top" ALIGN="right"><STRONG>Sizin Mailiniz:</STRONG></TD>
<TD><INPUT TYPE="text" NAME="txtFromEmail" VALUE="" SIZE="30"></TD>
</TR>
<TR>
<TD VALIGN="top" ALIGN="right"><STRONG>Arkadasinizin Maili:</STRONG></TD>
<TD><INPUT TYPE="text" NAME="txtToEmail" VALUE="" SIZE="30"></TD>
</TR>
<TR>
<TD VALIGN="top" ALIGN="right"><STRONG>Mesaj:</STRONG></TD>
<TD><TEXTAREA NAME="txtMessage" COLS="50" ROWS="5" WRAP="virtual" READONLY></TEXTAREA>
</TR>
<TR>
<TD></TD>
<TD><INPUT TYPE="reset" VALUE="SİL" name=rstReferral> <INPUT TYPE="submit" VALUE="GÖNDER" name=subReferral></TD>
</TR>
</TABLE>
</FORM>
<%
'<P>The Message to be sent:</P>
'<P><B>Subject:</B> < %= strSubject % ></P>
'<P><B>Body:</B> < %= strBody % ></P>
End Sub
' This just shows our thank you message... probably didn't need to
' be a function, but since I made the form one I figured I'd do this
' for consistency.
Sub ShowThanksMsg()
%>
<P></P>
<%
End Sub
%>
"<!--#include file="sifre.asp"--> yöntemi ile ekliyoruz
<%
logstatus=request.QueryString("logadm")
if logstatus="true" then
session("user_admin")=""
session.Contents.RemoveAll()
session.Abandon()
'response.Redirect("Cikistamamlaninca yonlenecek sayfa")
end if
action=request.form("action")
if action="login" then
kullanici=trim(request.Form("kullanici"))
sifre=trim(request.Form("sifre"))
if kullanici="lugelas" AND sifre="lugelas" then
session.Timeout=180
session("user_admin")="admin"
response.Redirect("giristamam.asp")
else
error_msg="Yanlış kullanıcı veya şifre"
end if
end if
%>
<html>
<head>
<title>Admin giris</title>
<**** **********="Content-Type" content="text/html; charset=windows-1254">
</head>
<body>
<p> </p>
<p> </p>
<form action="default.asp" method="post" name="giris" target="_top" id="giris" >
<table width="256" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FF0099">
<tr>
<td>
<table width="254" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr>
<td colspan="2"><div align="center"><font color="#990000"><%=error_msg%> </font></div></td>
</tr>
<tr>
<td width="95">Kullanıcı</td>
<td width="305"><input name="kullanici" type="text" id="kullanici" size="19" maxlength="20" style="width:100"></td>
</tr>
<tr>
<td>Şifre</td>
<td><input name="sifre" type="password" id="sifre" size="20" maxlength="20" style="width:100"></td>
</tr>
<tr>
<td> </td>
<td><input name="Submit" type="submit" class="submit" value="Giriş">
<input name="action" type="hidden" id="action" value="login"></td>
</tr>
</table>
</td></tr></table>
</form>
</body>
</html>
----------------
Bu kodlar ile istediğiniz sayfayı ziyaretçinizin arkadaşına tavsiye etmesini sağlayabilirsiniz.
<H3>Tavsiye </H3>
<%
Dim objCDONTS
Dim strFromName
Dim strFromEmail, strToEmail
Dim strSubject, strBody
Dim strThisPage
Dim strReferringPage
Dim bValidInput
strThisPage = Request.ServerVariables("SCRIPT_NAME")
strReferringPage = Request.ServerVariables("HTTP_REFERER")
' Debugging lines:
'Response.Write strThisPage & "<BR>" & vbCrLf
'Response.Write strReferringPage & "<BR>" & vbCrLf
' Read in and set the initial values of our message parameters
strFromName = Trim(Request.Form("txtFromName"))
strFromEmail = Trim(Request.Form("txtFromEmail"))
strToEmail = Trim(Request.Form("txtToEmail"))
strSubject = "Check out ASP 101!"
strBody = Trim(Request.Form("txtMessage"))
' I set the body message to a message that referenced the page the
' user arrived from. This makes it great if you place a link to it
' from your different articles, but can be weird if people link in
' from other web sites.
If strBody = "" Then
If strReferringPage = "" Or InStr(1, strReferringPage, "www.prowww.net", 1) = 0 Then
strBody = ""
strBody = strBody & "Bu site harika bir site.Mutlaka gez..." & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & " http://www.prowww.net" & vbCrLf
Else
strBody = ""
strBody = strBody & "Bu siteyi mutlaka gezmelisin" & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & " " & strReferringPage & vbCrLf
End If
End If
' Quick validation just to make sure our parameters are somewhat valid
bValidInput = True
bValidInput = bValidInput And strFromName <> ""
bValidInput = bValidInput And IsValidEmail(strFromEmail)
bValidInput = bValidInput And IsValidEmail(strToEmail)
' If valid send email and show thanks, o/w show form
If bValidInput Then
' Set up our email object and send the message
Set objCDONTS = Server.CreateObject("CDONTS.NewMail")
objCDONTS.From = strFromName & " <" & strFromEmail & ">"
objCDONTS.To = strToEmail
objCDONTS.Subject = strSubject
objCDONTS.Body = strBody
objCDONTS.Send
Set objCDONTS = Nothing
' Show our thank you message
ShowThanksMsg
Else
If "http://" & Request.ServerVariables("HTTP_HOST") & strThisPage = strReferringPage Then
Response.Write "Lutfen bos alan birakmayin.Mail adreslerini dogru yazin" & "<BR>" & vbCrLf
End If
' Show our information retrieval form
ShowReferralForm strThisPage, strFromName, strFromEmail, strToEmail, strBody
End If
' End of page logic... subs and functions follow!
%>
<%
' Subroutines and Functions that encapsulate some functionality
' and make the above code easier to write... and read.
' A quick email syntax checker. It's not perfect,
' but it's quick and easy and will catch most of
' the bad addresses than people type in.
Function IsValidEmail(strEmail)
Dim bIsValid
bIsValid = True
If Len(strEmail) < 5 Then
bIsValid = False
Else
If Instr(1, strEmail, " ") <> 0 Then
bIsValid = False
Else
If InStr(1, strEmail, "@", 1) < 2 Then
bIsValid = False
Else
If InStrRev(strEmail, ".") < InStr(1, strEmail, "@", 1) + 2 Then
bIsValid = False
End If
End If
End If
End If
IsValidEmail = bIsValid
End Function
' I made this a function just to get it out of the
' logic and make it easier to read. It just shows the
' form that asks for the input
Sub ShowReferralForm(strPageName, strFromName, strFromEmail, strToEmail, strBody)
' I use script_name so users can rename this script witout having to change the code.
%>
<FORM ACTION="<%= strPageName %>" METHOD="post" name=frmReferral>
<TABLE BORDER="0">
<TR>
<TD VALIGN="top" ALIGN="right"><STRONG>Adiniz:</STRONG></TD>
<TD><INPUT TYPE="text" NAME="txtFromName" VALUE="" SIZE="30"></TD>
</TR>
<TR>
<TD VALIGN="top" ALIGN="right"><STRONG>Sizin Mailiniz:</STRONG></TD>
<TD><INPUT TYPE="text" NAME="txtFromEmail" VALUE="" SIZE="30"></TD>
</TR>
<TR>
<TD VALIGN="top" ALIGN="right"><STRONG>Arkadasinizin Maili:</STRONG></TD>
<TD><INPUT TYPE="text" NAME="txtToEmail" VALUE="" SIZE="30"></TD>
</TR>
<TR>
<TD VALIGN="top" ALIGN="right"><STRONG>Mesaj:</STRONG></TD>
<TD><TEXTAREA NAME="txtMessage" COLS="50" ROWS="5" WRAP="virtual" READONLY></TEXTAREA>
</TR>
<TR>
<TD></TD>
<TD><INPUT TYPE="reset" VALUE="SİL" name=rstReferral> <INPUT TYPE="submit" VALUE="GÖNDER" name=subReferral></TD>
</TR>
</TABLE>
</FORM>
<%
'<P>The Message to be sent:</P>
'<P><B>Subject:</B> < %= strSubject % ></P>
'<P><B>Body:</B> < %= strBody % ></P>
End Sub
' This just shows our thank you message... probably didn't need to
' be a function, but since I made the form one I figured I'd do this
' for consistency.
Sub ShowThanksMsg()
%>
<P></P>
<%
End Sub
%>