0


I'm newbie here and try to learn here.

I wanna create a Classic asp program, and it's contain a section that users can make their form ( like contact, register and so on).

Now question is, when form created ( inputs have their name and id )
How i can read and save them in DB ( here Access DB )

Is anybody here that know an example of Web Form generator?
Please help and guide me
thanks

4

1 回答 1

1

您可以使用Request.Form("element_name")获取表单元素的值。

<%
    username = Request.Form("input-username")
    password = Request.Form("input-password")
%>  

考虑到您知道如何连接访问数据库,您可以将上述信息保存到数据库中,例如:

<%
    Rs.AddNew()
    Rs("username") = username
    Rs("password") = password
    Rs.Update()
%>

更新

要获取动态创建的表单值,您需要在 Request.Form 对象中执行for each... 循环。

<%
    for each item in Request.Form
        Response.Write item & "=" & Request.Form(item) & "<br />"
    next
%> 

另外我建议你阅读这篇文章

于 2012-07-08T07:24:22.510 回答