Wolf's ASP Toolbox--burglar chain, Judgment week

Source: Internet
Author: User
Tags date servervariables
Anti-Theft Chain | anti-theft chain

Anti-Theft chain

<%
Http=request.servervariables ("Http_referer")
Http2=cstr (Request.ServerVariables ("SERVER_NAME"))
If Mid (Http,8,len (HTTP2)) <>HTTP2 Then
Response.Write "This site is prohibited from downloading from the external site!" "
Else
Response.Redirect "Download.doc" ' Download.doc for download filename
End If
%>

-------------------------------------------------------

Judge how many days of the week

<%
Yue=month (date ())
Nian=year (date ())
thismon=nian& "-" &yue& "-1"
Nextmon=dateadd ("M", 1,thismon)
Tiancount=datediff ("D", Thismon,nextmon) ' Days of the Month

Wek= Weekday (date ())
Select Case Wek
Case 1
Response.Write "Sunday"
Case 2
Response.Write "Monday"
Case 3
Response.Write "Tuesday"
Case 4
Response.Write "Wednesday"
Case 5
Response.Write "Thursday"
Case 6
Response.Write "Friday"
Case 7
Response.Write "Saturday"
End Select

Yue=month (date ())
Nian=year (date ())
thismon=nian& "-" &yue& "-1"
Nextmon=dateadd ("M", 1,thismon)
Tiancount=datediff ("D", Thismon,nextmon) ' Days of the Month
Dim wek,wekday
Wek= Weekday (date ())
Select Case Wek
Case 1
Wekday= "Sunday"
Case 2
Wekday= "Monday"
Case 3
Wekday= "Tuesday"
Case 4
Wekday= "Wednesday"
Case 5
Wekday= "Thursday"
Case 6
Wekday= "Friday"
Case 7
Wekday= "Saturday"
End Select

"Response.Write" This Month "&tiancount&" Day, Today is "&wekday&"
%>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.