admin 管理员组

文章数量: 1086019


2024年2月6日发(作者:mouse的复数形式)

完整的动态网页代码 ,图片无缝滚动代码

时间代码

:

1

2

3

4.日期:

5.显示日期

天气预报的代码

一、天气预报的代码:

二、天气预报的代码:

天气预报

新闻频道代码

新闻代码

一.新闻糸统

1.查询开始的代码

<%

Set rs = Object ("set")

sql = "Select top 6 * from news order by id desc"

sql,conn,1,1

%>

2.循环开始代码

<%

if and then

("暂时还没有文章")

else

Do Until

%>

3.循环结束代码

<%

xt

Loop

end if

%>

4.查询结束代码

<%

Set rs = Nothing

set conn=Nothing

%>

******************************************************************************

二.新闻目录

1.循环开始代码

<%

Const MaxPerPage=18

dim totalPut

dim CurrentPage

dim TotalPages

dim j

dim sql

if Not isempty(request("page")) then

currentPage=Cint(request("page"))

else

currentPage=1

end if

set rs=Object("set")

sql="select * from news order by id"

sql,conn,1,1

a=1

if <>0 then

"数据库中无数据"

end if

if And then

"

暂没信息!

"

else

totalPut=count

if currentpage<1 then

currentpage=1

end if

if (currentpage-1)*MaxPerPage>totalput then

if (totalPut mod MaxPerPage)=0 then

currentpage= totalPut MaxPerPage

else

currentpage= totalPut MaxPerPage + 1

end if

end if

if currentPage=1 then

showContent

showpage totalput,MaxPerPage,""

else

if (currentPage-1)*MaxPerPage

(currentPage-1)*MaxPerPage

dim bookmark

bookmark=rk

showContent

showpage totalput,MaxPerPage,""

else

currentPage=1

showContent

showpage totalput,MaxPerPage,""

end if

end if

end if

sub showContent

dim i,j

i=0

%>

<% do while not %>

2.循环结束代码

<% i=i+1

j=j+1

if i>=MaxPerPage then Exit Do

if i mod 2= 0 then ("")

xt

loop

set rs=nothing

%>

3.翻页执行代码

<%

End Sub

Function showpage(totalnumber,maxperpage,filename)

Dim n

If totalnumber Mod maxperpage=0 Then

n= totalnumber maxperpage

Else

n= totalnumber maxperpage+1

End If

"

"

"

"

If CurrentPage<2 Then

"首页 上一页 "

Else

"首页 "

"上一页

"

End If

If n-currentpage<1 Then

"下一页 尾页"

Else

""

"下一页 尾页"

End If

" 页次:

class='contents'>"&CurrentPage&"/"&n&"页 "

" 共有"&totalnumber&"个信息 "

"转到:

maxlength=10 class=smallInput value="¤tpage&">"

"

End Function

%>

******************************************************************************

三.显示新闻的初始代码

<%

dim id

id=tring("id")

set rs=Object("set")

sql="select * from news where id="&id&""

sql,conn,1,1

%>

2.释放代码

<%

set rs=nothing

set conn=Nothing

%>