Visualizzazione dei risultati da 1 a 7 su 7

Discussione: Insert Help

  1. #1

    Insert Help

    codice:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%
    set rSdomande = connect.execute("SELECT * FROM domande where domande.id = 1 ")
    
    
    if request("action") = "go" then
    txtId=request.form("id")
    txtSi=request.form("si")
    txtNo=request.form("no")
    txtNonso=request.form("nonso")
    
    if txtSi=1 then
    connect.execute ("insert into vote (id_dom, si, no, nonso) values (1,1,0,0)")
    end if
    
    if txtNo=1 then
    connect.execute ("insert into vote (id_dom, si, no, nonso) values (1,0,1,0)")
    end if
    
    if txtNonso=1 then
    connect.execute ("insert into vote (id_dom, si, no, nonso) values (1,0,0,1)")
    end if
    
    response.redirect "stepx.asp"
    
    end if
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    .style2 {
    	font-size: 20px;
    	color: #0000FF;
    	font-family: "Courier New", Courier, monospace;
    }
    .style3 {
    	font-size: 16px;
    	font-weight: bold;
    	color: #FFFFFF;
    	font-family: "Courier New", Courier, monospace;
    }
    .style9 {
    	font-size: 24px;
    	font-style: italic;
    }
    .style14 {
    	font-family: "Courier New", Courier, monospace;
    	font-size: 18px;
    }
    .style15 {
    	font-family: "Courier New", Courier, monospace;
    	font-size: 16px;
    }
    .style16 {font-family: "Courier New", Courier, monospace}
    -->
    </style>
    </head>
    
    <body>
    <table width="20%" border="0" align="right" cellpadding="2" cellspacing="2">
      <tr>
        <td><div align="right" class="style9">1/20</div></td>
      </tr>
    </table>
    
    
    </p>
    <table width="100%" border="0" cellspacing="4" cellpadding="5">
      <tr>
        <td colspan="2"><h4 class="style2">1 - aaaa </h4></td>
      </tr>
      <tr>
        <td colspan="2" bgcolor="#990000"><span class="style3">xxxx</span> </td>
      </tr>
      <tr>
        <td colspan="2"></td>
      </tr>
      <tr>
        <td width="86%" align="left" valign="top" bgcolor="#F9F9F9"><span class="style14">
          <input type="hidden" value="<% =rSdomande("id") %>"><% =rSdomande("domanda") %>
        </span></td>
        <td width="14%" align="left" valign="top" bgcolor="#F6F6F6"><div align="center">
          <p align="left" class="style16">
            <input name="vote" type="radio" value="1" id="si">
            Si
     
              <input name="vote" type="radio" value="1" id="no">
            No
    
             <input name="vote" type="radio" value="1" id="nonso">
            Non so      </p>
          <label for="radiobutton"></label>
        </div></td>
      </tr>
    </table>
    </form>
    
    
    
      <label for="Submit"></label>
    </p>
    <p align="center"></p>
    <p align="center">
    AVANTI &gt;&gt;</p>
    </body>
    </html>
    non mi inserisce nel db nulla ...
    la connessione funziona perfettamente
    dove sbaglio?! tnx

  2. #2
    codice:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%
    set rSdomande = connect.execute("SELECT * FROM domande where domande.id = 1 ")
    
    
    if request.form("action") = "go" then
    txtId = request.form("id")
    txtSi = request.form("si")
    txtNo = request.form("no")
    txtNonso=request.form("nonso")
    
    if txtSi = 1 then
    connect.execute ("insert into vote (id_dom, si, no, nonso) values (1,1,0,0)")
    end if
    
    if txtNo = 1 then
    connect.execute ("insert into vote (id_dom, si, no, nonso) values (1,0,1,0)")
    end if
    
    if txtNonso = 1 then
    connect.execute ("insert into vote (id_dom, si, no, nonso) values (1,0,0,1)")
    end if
    
    connect.close
    set connect = nothing
    
    response.redirect "stepx.asp"
    
    end if
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    .style2 {
    	font-size: 20px;
    	color: #0000FF;
    	font-family: "Courier New", Courier, monospace;
    }
    .style3 {
    	font-size: 16px;
    	font-weight: bold;
    	color: #FFFFFF;
    	font-family: "Courier New", Courier, monospace;
    }
    .style9 {
    	font-size: 24px;
    	font-style: italic;
    }
    .style14 {
    	font-family: "Courier New", Courier, monospace;
    	font-size: 18px;
    }
    .style15 {
    	font-family: "Courier New", Courier, monospace;
    	font-size: 16px;
    }
    .style16 {font-family: "Courier New", Courier, monospace}
    -->
    </style>
    </head>
    
    <body>
    <form method="post" name="form1" action="<%=request.serverVariables("PATH_INFO")%>">
    <table width="20%" border="0" align="right" cellpadding="2" cellspacing="2">
      <tr>
        <td><div align="right" class="style9">1/20</div></td>
      </tr>
    </table>
    
    
     </p>
    <table width="100%" border="0" cellspacing="4" cellpadding="5">
      <tr>
        <td colspan="2"><h4 class="style2">1 - aaaa </h4></td>
      </tr>
      <tr>
        <td colspan="2" bgcolor="#990000"><span class="style3">xxxx</span> </td>
      </tr>
      <tr>
        <td colspan="2"> </td>
      </tr>
      <tr>
        <td width="86%" align="left" valign="top" bgcolor="#F9F9F9"><span class="style14">
          <input type="hidden" value="<% =rSdomande("id") %>"><% =rSdomande("domanda") %>
        </span></td>
        <td width="14%" align="left" valign="top" bgcolor="#F6F6F6"><div align="center">
          <p align="left" class="style16">
            <input name="vote" type="radio" value="1" id="si">
            Si
     
              <input name="vote" type="radio" value="1" id="no">
            No
    
             <input name="vote" type="radio" value="1" id="nonso">
            Non so      </p>
          <label for="radiobutton"></label>
        </div></td>
      </tr>
    </table>
    
    
    
      <label for="Submit"></label>
    </p>
    <p align="center"> </p>
    <p align="center">
    <input type="hidden" name="action" value="go">
    AVANTI &gt;&gt;</p>
    </form>
    </body>
    </html>

  3. #3
    non vā

  4. #4
    Hai copiato paro paro quello che ho scritto io?

  5. #5
    si, nel db nn scrive nulla

  6. #6
    codice:
    voto = request.form("voto")
    
    if voto = 1 then
    connect.execute ("insert into vote (id_dom, si, no, nonso) values (1,1,0,0)")
    end if
    
    if voto = 0 then
    connect.execute ("insert into vote (id_dom, si, no, nonso) values (1,0,1,0)")
    end if
    
    if voto = 3 then
    connect.execute ("insert into vote (id_dom, si, no, nonso) values (1,0,0,1)")
    end if
    
    
            <p align="left" class="style16">
            <input name="vote" type="radio" value="1" id="si">
            Si
     
              <input name="vote" type="radio" value="0" id="no">
            No
    
             <input name="vote" type="radio" value="3" id="nonso">
            Non so      </p>

  7. #7
    ho dimenticato:
    codice:
    voto = request.form("voto")
    if isNumeric(voto) then voto = cint(voto)

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.