<% ' Thanks to Tom Holder, who developed the IP restriction, ' "additional information" extension and ported graphical ' display for visitors. ' Visit his site at http://www.ymonda.co.uk/ for more ' ASP source code and products. lAnketID = request("ID") set conn = Server.CreateObject("ADODB.Connection") Set rs = Server.CreateObject("ADODB.Recordset") conn.open sConnAnket set rs.ActiveConnection = conn rs.CursorType = adOpenStatic if Request("Id") <> "" Then sSQL = "SELECT SurveyID, SurveyName, SurveyQuestion FROM Surveys WHERE SurveyID = " & lAnketID else sql="SELECT SurveyID FROM Surveys ORDER BY SurveyID DESC" rs.Open SQL, , , adCmdTable response.write "" LastId=rs("SurveyID") rs.Close sSQL = "SELECT SurveyID, SurveyName, SurveyQuestion FROM Surveys WHERE SurveyID = " & LastId end if if lAnketID <> "" then lastId=lAnketID end if rs.Open sSQL, , , adCmdTable if rs.eof or rs.bof then response.write "Errore : Non si è trovato il sondaggio
ID del sondaggio:" & lastId response.end end if sSurveyName = rs("SurveyName") sSurveyQuestion = rs("SurveyQuestion") rs.close %>

 

<% sSQL = "SELECT OptionID, OptionText, AdditionalInformation FROM Options WHERE SurveyID = " & lastId rs.Open sSQL, , , adCmdTable do while not rs.eof %> <% rs.movenext loop rs.close %>
<%=sSurveyQuestion%>
"> <%If rs("AdditionalInformation") <> "" then%> &name=<%=Server.URLEncode(rs("OptionText"))%>')"><%=rs("OptionText")%> <%Else%> <%=rs("OptionText")%> <%End If%>