mysql - 如何在经典asp中获取文本框的值并上传到数据库

标签 mysql asp-classic request.servervariables

如何获取 poNo 文本框的值并将其更新到数据库。 我尝试使用 ' request.Form("poNo") ' 获取值,但它不起作用......

请帮忙!

<html>
<head>
<body>
  <%
     if(Request.ServerVariables("REQUEST_METHOD") = "POST") then
       updateInvoice = "Update unassignedinvoice set poNo='" & request.Form("poNo") & "')  where id=" & Request.QueryString("UO")
       adoConn.execute updateInvoice
     end if 
  %>

<form action="view_unapproved_invoices.asp?UO=<%response.Write(request.QueryString("UO"))%>"  enctype="multipart/form-data" method="POST">

  <% 
    invoicesSQL = "Select pono from unassignedinvoice where id = " & Request.QueryString("UO")
    set adoRSinvoices = Server.CreateObject("ADODB.Recordset")
    adoRSinvoices.open invoicesSQL, adoConn
  %>

  <table>
  <tr>
  <td style="text-align: left"> PO Number </td>
        <td> 
            <input id="poNo" type="text" value='<%=adoRSinvoices.fields("pono")%>' 
                align="right" /></td>
    </tr>
    <tr>
      <td> 
              <input id="Submit" align="right" type="submit" value="Upload" />  
       </td>
    </tr>
  </table> 

 </form>
</head>
</body>
</html>

最佳答案

您在表单标记中指定 enctype="multipart/form-data" 的原因是什么?

如果你删除它,它应该可以工作。

如果你需要那个,即。如果您要在此页面上传文件,那么您必须根据用于上传文件的组件访问表单字段

关于mysql - 如何在经典asp中获取文本框的值并上传到数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24965605/

相关文章:

php - 查询返回日期 (YYYY-MM-DD) 并希望显示为 10 月 15 日星期五

asp.net - 将(单体)经典 ASP 迁移到 ASP.Net

asp.net - 我可以在 .NET 中设置服务器变量吗

C# 在 Windows 窗体或控制台上使用 HttpListener 和 Request.ServerVariables

MySQL创建一个循环自身的存储过程

mysql - 如何将复杂的 linux 终端命令的输出插入到 mysql 数据库表中

mysql - 经典ASP mysql INSERT获取结果 Operation is not allowed when the object is closed

json - 将 Json 字符串解析为经典 ASP 页面

php - Mysql Utf-8 和 PHP