为什么调用后首页不显示呢?
yn518 2005-04-02 03:25:10 <%@LANGUAGE="VBSCRIPT"%>
<%
Option Explicit
Dim Conn,Sql,Rs,Mjs,intNum,User,intLang
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("../hxk/xhgmind.mdb")
Const strUrl = "¡¤<font color=#666666>[{$Class}] </font><a href=""game/gamemind/ArticleShow.asp?ArticleID={$Theid}"" title={$Thenote} class=b>{$Font}</a><br>"
intNum = CInt(Request.QueryString("n"))
intLang = CInt(Request.QueryString("c"))
Sql = "Select Top " & intNum & " ArticleID,BigClassName,Title from Article order by UpdateTime Desc,ArticleID Desc"
Set Rs = Conn.Execute(Sql)
If Not Rs.Eof Then
Mjs = Rs.Getrows()
End If
Set Rs = Nothing
Conn.Close : Set Conn = Nothing
If IsArray(Mjs) Then
Dim i
For i = 0 To Ubound(Mjs,2)
User = User & Replace(Replace(Replace(Replace(strUrl,"{$Font}",trimCode(Mjs(2,i))),"{$Thenote}",Mjs(2,i)),"{$Theid}",Mjs(0,i)),"{$Class}",Mjs(1,i))
Next
Response.write "document.write('"&User&"');"
End If
Function trimCode(sCode)
If Len(sCode)>intLang Then
trimCode = Left(sCode,intLang)
Else
trimCode = sCode
End If
End Function
%>
保存为 Youxi_tran.asp 首页中调用<script src="mjs_img/Youxi_tran.asp?n=10&c=15"></script> 这是一个能显示的
底下的却显示不了
<%@LANGUAGE="VBSCRIPT"%>
<%
Option Explicit
Dim Conn,Sql,Rs,Mjs,intNum,User,intLang
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("../hxk/monkey.asp")
Const strUrl = "¡¤<a href=""house/newsshow.asp?id={$Theid}"" title={$Thenote} class=b>{$Font}</a><br>"
intNum = CInt(Request.QueryString("n"))
intLang = CInt(Request.QueryString("c"))
Sql = "Select Top " & intNum & " ID,TYPE From News Order By dat Desc,ID Desc"
Set Rs = Conn.Execute(Sql)
If Not Rs.Eof Then
Mjs = Rs.Getrows()
End If
Set Rs = Nothing
Conn.Close : Set Conn = Nothing
If IsArray(Mjs) Then
Dim i
For i = 0 To Ubound(Mjs,2)
User = User & Replace(Replace(Replace(strUrl,"{$Font}",trimCode(Mjs(1,i))),"{$Theid}",Mjs(0,i)),"{$Thenote}",Mjs(1,i))
Next
Response.write "document.write('"&User&"');"
End If
Function trimCode(sCode)
If Len(sCode)>intLang Then
trimCode = Left(sCode,intLang) & ".."
Else
trimCode = sCode
End If
End Function
%>