A friend in the group browsed my ASP98.cn website today. She said that it is best to make a list of the content of the day. Users are generally too lazy to look down. It feels very reasonable, this is the so -called user experience, haha! Just do it! So get at 1:30 in the middle of the night ... - #
The content list is very simple, so I wo n’t say much here. First of all, the idea is to define a variable acquisition value to query the database. If it is empty, it is equal to the current time.
1. variable definition
The code is as follows: DIM variables 'names' name, I will not get my name anymore. If request.querystring (parameter) = then Variable name = now () Else Variable name = request.querystring (parameter) End if |
2. Determine whether the date format is correct
After this program is done well, I will consider it, and now I feel that it should be placed here with his importance
(Knowledge point: ISDATE function)
The following is a quotation fragment: If not isdate (variable name) then Variable name = now () End if |
Database query
(Knowledge point: use a Datediff time function here)
The following is a quotation fragment: SQL = Select * from [Table] Where Datediff ('D', Database Time, '& Variable Name &') = 0 Order by ID DESC .................... |
4. Finally add a link
The following is a quotation fragment: One day before the day |
You can add a judgment in the next day
<%If datingiff (d, variable name, now ())> 0 then%> Links of the day after displaying <%end if%>
Regarding this link, (*^__^*), I tried a lot of methods to get the correct result, so I used the dumbest method to read the year, month, and day, and then increase and subtract in the place of heaven. Essence If you have a better way, please contact me! QQ: 3277121, or contact me at my website http: www.asp98.cn.
For specific examples, please see the http://asp98.cn/arclist.asp page of this site!