Visualizzazione dei risultati da 1 a 6 su 6

Discussione: sondaggio in asp.net

  1. #1

    sondaggio in asp.net

    salve a tutti, sapete se esiste uno script per un sondaggio pronto da emttere in un sito ?

    GRAZIE
    Tu sei uno schiavo Neo!
    Come tutti gli altri sei nato in catene,
    sei nato in una prigione che non ha sbarre, che non ha mura, che non ha odore,una prigione per la tua mente!".
    Morpheus

  2. #2
    nessuno ?

    oppure data la mia ignoranza, io ne ho uno fatto in asp, sapete tradurlo in asp.net ?
    codice:
    <%
    'Two varibles are passed into the db
    'u_input is the value if the user entered a response to
    'the vote/poll question....IP is the address of the user
    
    u_input=request.form("u_input")
    u_ip=request.servervariables("remote_addr")
    
    ' if the user did not enter anything in the poll on this visit
    ' then display the poll question and possible choices
    if u_input = "" then
    %>
    <form method="post" action="<%= request.servervariables("script_name") %>">
    <table width="138" border="0" align="center">
                      <tr><td align="left">
    				<center>
    			   <font color="#548F96">Quale &egrave; il tuo personaggio 
                    preferito ?</font>
    
    				</center>
    			<input type="radio" name="u_input" value="1">Morpheus
    
    			<input type="radio" name="u_input" value="2">Neo
    
    			<input type="radio" name="u_input" value="3">Trinity
    
    			<input type="radio" name="u_input" value="4">Agente Smith
    
    			<center><input type="submit" value="Vota" ></center></p>
    				</td></tr></table>
    </form>
    
    <%
    else' if the user did input a choice on the vote/ballot
    
    ' check to see if their ip address is already in the db
    accessdb="../../mdb-database/votes_db" 
    cn="driver={Microsoft Access Driver (*.mdb)};"
    cn=cn & "dbq=" & server.mappath(accessdb)
    set rs = server.createobject("ADODB.Recordset")
    sql = "select ip from ballot where ip ='" & u_ip & "'"
    
    rs.Open sql, cn
    if rs.eof then
    ' if the user has not voted previously indicate it
    been_here_before="No"
    end if
    rs.close
    
    if been_here_before = "No" then
    ' Since the user has not voted previously their input
    ' their vote will be added to the db
    
    sql = "insert into ballot (ip, selection" & u_input &") "
    sql = sql & "values ('" & u_ip & "',1)"
    rs.Open sql, cn
    end if
    
    'This will summerize and count the records in the db
    sql= "select distinctrow sum(selection1) as sum_selection1, " 
    sql= sql & "sum(selection2) AS sum_selection2, sum(selection3) AS sum_selection3, "
    sql= sql & "sum(selection4) AS sum_selection4, count(*) AS total_votes "
    sql= sql & "FROM ballot;"
    rs.Open sql, cn
    total1=rs ("sum_selection1")
    total2=rs ("sum_selection2")
    total3=rs ("sum_selection3")
    total4=rs ("sum_selection4")
    count=rs ("total_votes")
    
    %>
    GRAZIE
    Tu sei uno schiavo Neo!
    Come tutti gli altri sei nato in catene,
    sei nato in una prigione che non ha sbarre, che non ha mura, che non ha odore,una prigione per la tua mente!".
    Morpheus

  3. #3

  4. #4
    GRAZIE
    Tu sei uno schiavo Neo!
    Come tutti gli altri sei nato in catene,
    sei nato in una prigione che non ha sbarre, che non ha mura, che non ha odore,una prigione per la tua mente!".
    Morpheus

  5. #5
    Originariamente inviato da Morpheus2001
    GRAZIE
    ...ne ho trovato un altro:
    http://www.aspfree.com/articles/1336,1/articles.aspx
    "I video giochi non influenzano i bambini. Voglio dire, se Pac-man avesse influenzato la nostra generazione, staremmo tutti saltando in sale scure, masticando pillole magiche e ascoltando musica elettronica ripetitiva!" (Kristian Wilson, Nintendo Inc., 1989)
    Pochi anni dopo naquero le feste rave, la musica techno e l'ecstasy...

    :quote:

  6. #6
    Grazie anche a te
    Tu sei uno schiavo Neo!
    Come tutti gli altri sei nato in catene,
    sei nato in una prigione che non ha sbarre, che non ha mura, che non ha odore,una prigione per la tua mente!".
    Morpheus

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.