获得投票代码

<% dim id,act,title,optionNum,optionType,votestatus,expiresTime,voteType id=cint(request("id")) if(id<1) then response.Write("没有找到id="&id&"的记录！") response.End() end if dim voteid,tempArr Set rs = Server.CreateObject("Adodb.RecordSet") rs.Open "Select top 1 * from vote where id="&id,conn,3,1 if not rs.eof then title=rs("title") optionType=rs("optionType") if(optionType=0) then voteType="radio" else voteType="checkbox" end if if(rs("status")<>1) then response.Write("投票已过期或暂时关闭.") response.End() end if If datediff("s",now(),formatdatetime(rs("expiresTime")))<0 then response.Write("投票已过期.") response.End() end if else response.Write("没有找到记录") response.End() end if rs.close set rs=nothing ''''''''''''''''''''''''''''''''''初使化'''''''''''''''''''''''''''' dim tempJsStr tempJsStr="" tempJsStr=tempJsStr&"document.write('');"&Chr(10) tempJsStr=tempJsStr&"document.write('

');"&Chr(10) tempJsStr=tempJsStr&"document.write('
');"&Chr(10) tempJsStr=tempJsStr&"document.write('
"&title&" ');"&Chr(10) tempJsStr=tempJsStr&"document.write('
');"&Chr(10) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' dim voteArr Set rs = Server.CreateObject("Adodb.RecordSet") rs.Open "Select id,itemName,clicks,colors from voteitem where voteid="&id,conn,3,1 if not rs.eof then voteArr=rs.GetRows() rs.close set rs=nothing for i=0 to ubound(voteArr,2) tempJsStr=tempJsStr&"document.write('
');"&Chr(10) tempJsStr=tempJsStr&"document.write('
■ ');"&Chr(10) tempJsStr=tempJsStr&"document.write(' | ');"&Chr(10) tempJsStr=tempJsStr&"document.write(' ');"&Chr(10) tempJsStr=tempJsStr&"document.write(' "&voteArr(1,i)&" ');"&Chr(10) tempJsStr=tempJsStr&"document.write(' ');"&Chr(10) tempJsStr=tempJsStr&"document.write('
');"&Chr(10) next else rs.close set rs=nothing end if tempJsStr=tempJsStr&"document.write('
');"&Chr(10) tempJsStr=tempJsStr&"document.write('
');"&Chr(10) tempJsStr=tempJsStr&"document.write(' | ');"&Chr(10) tempJsStr=tempJsStr&"document.write(' ');"&Chr(10) tempJsStr=tempJsStr&"document.write(' "">');"&Chr(10) tempJsStr=tempJsStr&"document.write(' ');"&Chr(10) tempJsStr=tempJsStr&"document.write('
');"&Chr(10) tempJsStr=tempJsStr&"document.write('

');"&Chr(10) tempJsStr=tempJsStr&"document.write('');"&Chr(10) Set fs=Server.CreateObject("Scripting.FileSystemObject") Set file_w = fs.CreateTextFile(server.mappath("../vote/js_"&id&".js"),true) file_w.WriteLine(tempJsStr) file_w.close set file_w=nothing response.write("

投票"&title&"的调用代码为：
<script src=""/vote/js_"&id&".js""></script>

") response.write("

请将以上代码复制到您要插入投票的地方。

") response.write("

<==返 回

") call connclose() %>