新人求帮助,asp注册页面
asp吧
全部回复
仅看楼主
level 1
Camus✨ 楼主
已经设置插入记录了,在网页预览点注册,不跳转也没有在数据库中插入记录,这是怎么回事啊
<form ACTION="<%=MM_editAction%>" METHOD="POST" enctype="multipart/form-data" name="form1" id="form1">
<table width="510" height="233" border="0" align="center" cellpadding="0" cel
lsp
acing="0">
<tr>
<td width="157" align="right">用户名:</td>
<td width="360" height="58"><label for="textfield"></label>
<input name="name" type="text" id="name" size="29" maxlength="30" /></td>
</tr>
<tr>
<td height="45" align="right">密码:</td>
<td height="45"><label for="textfield2"></label>
<input name="mima" type="password" id="mima" size="30" maxlength="30" /></td>
</tr>
<tr>
<td height="30" align="right">确认密码:</td>
<td height="45" valign="middle"><label for="textfield3"></label>
<p>
<input name="textfield3" type="password" id="textfield3" size="29" maxlength="30" />
</p></td>
</tr>
<tr>
<td height="31" align="right">联系方式:</td>
<td height="45"><label for="textfield4"></label>
<input name="lxfs" type="text" id="lxfs" size="29" maxlength="30" /></td>
</tr>
<tr>
<td height="50" colspan="2" align="center" valign="bottom"><input type="submit" name="button" id="button" value="注册" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
2014年07月27日 03点07分 1
level 12
把接受页面写出来。
2014年07月27日 07点07分 2
0.0页面是什么,不好意思,我是个新手,自己照教程做的,求大神帮帮忙
2014年07月27日 07点07分
@Camus✨ 就是那个存入数据库的页面
2014年07月27日 07点07分
回复 bai渡wo爱 :是这个吗,代码我放楼下了
2014年07月27日 07点07分
level 1
Camus✨ 楼主
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/deng.asp" -->
<%
Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
* boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
If (CStr(Request("MM_insert")) = "form1") Then
If (Not MM_abortEdit) Then
* execute the insert
Dim MM_editCmd
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_deng_STRING
MM_editCmd.CommandText = "INSERT INTO deng (name, mima, lxfs) VALUES (?, ?, ?)"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 255, Request.Form("name")) * adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 255, Request.Form("mima")) * adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 255, Request.Form("lxfs")) * adVarWChar
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
* append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "indax1.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
<%
Dim deng
Dim deng_cmd
Dim deng_numRows
Set deng_cmd = Server.CreateObject ("ADODB.Command")
deng_cmd.ActiveConnection = MM_deng_STRING
deng_cmd.CommandText = "SELECT * FROM deng"
deng_cmd.Prepared = true
Set deng = deng_cmd.Execute
deng_numRows = 0
%>
2014年07月27日 07点07分 3
level 12
几句代码就能搞定的事,你却写那么长的代码,你应该换本书。
2014年07月27日 07点07分 4
level 12
我现在外出,今晚给你回复
2014年07月27日 07点07分 5
哦哦,好的,非常感谢[乖]
2014年07月27日 07点07分
level 6
这明显是DW里面直接生成的代码 兄弟最好不要用 ASP代码很好写的
你那个问题 ACTION 其它就是让它提交到一个网址就行
enctype="multipart/form-data"
这句不用也行
http://www.51ity.com/programt_ASP_2.html IT园-程序基地 看看这个 或许对你有用
2014年07月28日 01点07分 6
level 12
楼主,你用insert into 吧,你的代码太长了看的我头昏
2014年07月28日 03点07分 7
1