|
作者: zjhacker [zjhacker] 论坛用户 | 登录 |
求助各们,我自己的论坛,数据库用Access,可是注册页面做完了,测试的时候,在填完注册信息后却不能转到注册成功页,而且也没有把数据写入到数据库中,这是为什么呀,一开始的时候还没有问题可是后来改了点东西就不行了,可能并不是因为改东西的原固,弄了一晚上也没搞明白是那里出问题了,哪们兄弟做论坛比较熟,可否指点一下小弟,在这先谢谢了!!!急等您回复!!! |
地主 发表时间: 04-04-05 07:36 |
回复: zjhacker [zjhacker] 论坛用户 | 登录 |
|
B1层 发表时间: 04-04-05 15:12 |
回复: zjhacker [zjhacker] 论坛用户 | 登录 |
靠,不是吧没有人回复呀,没人知道吗?不行我的帮自己顶! |
B2层 发表时间: 04-04-05 16:44 |
回复: zml2236 [zml2236] 论坛用户 | 登录 |
你把相关的代码写出来看看再说 |
B3层 发表时间: 04-04-05 16:45 |
回复: lilong [lilong] 论坛用户 | 登录 |
一起看一看 贴上来 |
B4层 发表时间: 04-04-05 17:08 |
回复: zjhacker [zjhacker] 论坛用户 | 登录 |
OK!一会贴 |
B5层 发表时间: 04-04-05 17:15 |
回复: lilong [lilong] 论坛用户 | 登录 |
嘿嘿好Y |
B6层 发表时间: 04-04-05 17:22 |
回复: zjhacker [zjhacker] 论坛用户 | 登录 |
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!--#include file="../Connections/members.asp" --> <% ' *** Edit Operations: declare variables Dim MM_editAction Dim MM_abortEdit Dim MM_editQuery Dim MM_editCmd Dim MM_editConnection Dim MM_editTable Dim MM_editRedirectUrl Dim MM_editColumn Dim MM_recordId Dim MM_fieldsStr Dim MM_columnsStr Dim MM_fields Dim MM_columns Dim MM_typeArray Dim MM_formVal Dim MM_delim Dim MM_altVal Dim MM_emptyVal Dim MM_i 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 MM_abortEdit = false ' query string to execute MM_editQuery = "" %> <% ' *** Insert Record: set variables If (CStr(Request("MM_insert")) = "form1") Then MM_editConnection = MM_members_STRING MM_editTable = "zhuce1_table" MM_editRedirectUrl = "zhuceOK.asp" MM_fieldsStr = "ID|value|password|value|passtw|value|passhd|value|name|value|xingbei|value|Email|value|shenri|value|homepage|value|ICQ|value|OICQ|value|zhiyei|value|xueli|value|add|value|beizhu|value" MM_columnsStr = "ID|',none,''|password|',none,''|passtw|',none,''|passhd|',none,''|name|',none,''|xingbei|',none,''|Email|',none,''|shenri|',none,NULL|homepage|',none,''|ICQ|none,none,NULL|OICQ|none,none,NULL|zhiyei|',none,''|xueli|',none,''|add|',none,''|beizhu|',none,''" ' create the MM_fields and MM_columns arrays MM_fields = Split(MM_fieldsStr, "|") MM_columns = Split(MM_columnsStr, "|") ' set the form values For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i))) Next ' append the query string to the redirect URL If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString Else MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString End If End If End If %> <% ' *** Insert Record: construct a sql insert statement and execute it Dim MM_tableValues Dim MM_dbValues If (CStr(Request("MM_insert")) <> "") Then ' create the sql insert statement MM_tableValues = "" MM_dbValues = "" For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_formVal = MM_fields(MM_i+1) MM_typeArray = Split(MM_columns(MM_i+1),",") MM_delim = MM_typeArray(0) If (MM_delim = "none") Then MM_delim = "" MM_altVal = MM_typeArray(1) If (MM_altVal = "none") Then MM_altVal = "" MM_emptyVal = MM_typeArray(2) If (MM_emptyVal = "none") Then MM_emptyVal = "" If (MM_formVal = "") Then MM_formVal = MM_emptyVal Else If (MM_altVal <> "") Then MM_formVal = MM_altVal ElseIf (MM_delim = "'") Then ' escape quotes MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'" Else MM_formVal = MM_delim + MM_formVal + MM_delim End If End If If (MM_i <> LBound(MM_fields)) Then MM_tableValues = MM_tableValues & "," MM_dbValues = MM_dbValues & "," End If MM_tableValues = MM_tableValues & MM_columns(MM_i) MM_dbValues = MM_dbValues & MM_formVal Next MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")" If (Not MM_abortEdit) Then ' execute the insert Set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = MM_editConnection MM_editCmd.CommandText = MM_editQuery MM_editCmd.Execute MM_editCmd.ActiveConnection.Close If (MM_editRedirectUrl <> "") Then Response.Redirect(MM_editRedirectUrl) End If End If End If %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>论坛注册</title> <style type="text/css"> <!-- body { background-image: url(../image/bj.gif); } .style1 {font-size: 12px} .style3 {font-size: 12px; color: #FF0000; } .style5 {font-size: 12px; color: #0000FF; } --> </style> </head> <body> <table width="780" height="600" border="0" align="center" cellspacing="0"> <tr> <td width="780" height="142" colspan="3"><div align="center"><img src="../image/ymlogo.jpg" width="780" height="142"></div></td> </tr> <tr> <td height="20" colspan="3"><div align="center"> <table width="780" height="20" border="0" cellpadding="0" cellspacing="0"> <tr> <td background="../image/bgomk.gif"><div align="center" class="style1"><strong>义盟网络论坛用户注册</strong></div></td> </tr> </table> <strong> </strong></div></td> </tr> <tr> <td width="100"> </td> <td width="580"><p align="left" class="style1"> </p> <table width="580" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="130"><span class="style1"></span></td> <td height="20"><span class="style3">新用户注册</span></td> </tr> <tr> <td><span class="style1"></span></td> <td height="20"><span class="style5">*号处为必填项</span></td> </tr> </table> <form method="post" action="<%=MM_editAction%>" name="form1"> <table align="center"> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="left"><span class="style1">* 用户名 :</span></div></td> <td> <input name="ID" type="text" value="" size="14" maxlength="16"> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="left"><span class="style1">*用户密码:</span></div></td> <td> <input name="password" type="password" value="" size="14" maxlength="16"> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><span class="style1">*重复密码:</span></td> <td><input name="password2" type="password" value="" size="14" maxlength="16"></td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="left"><span class="style1">*提示问题:</span></div></td> <td> <input name="passtw" type="text" value="" size="20" maxlength="20"> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="left"><span class="style1">*提示答案:</span></div></td> <td> <input name="passhd" type="text" value="" size="20" maxlength="20"> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="left"><span class="style1">*用户网名:</span></div></td> <td> <input name="name" type="text" value="" size="14" maxlength="14"> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="right"><span class="style1">性 别 :</span></div></td> <td> <select name="xingbei" size="1"> <option>保密</option> <option>男</option> <option>女</option> </select> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="right"><span class="style1">* Email :</span></div></td> <td> <input name="Email" type="text" value="" size="20" maxlength="20"> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="left" class="style1"> <div align="right">出生日期:</div> </div></td> <td> <span class="style1"> <input name="shenri" type="text" value="" size="4" maxlength="4"> 年 <input name="textfield" type="text" size="2" maxlength="2"> 月 <input name="textfield2" type="text" size="2" maxlength="2"> 日</span></td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="right"><span class="style1">个人主页:</span></div></td> <td> <input name="homepage" type="text" value="" size="32" maxlength="32"> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="right"><span class="style1">ICQ 号码:</span></div></td> <td> <input name="ICQ" type="text" value="" size="14" maxlength="14"> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="right"><span class="style1">QQ 号码:</span></div></td> <td> <input name="OICQ" type="text" value="" size="14" maxlength="14"> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="right"><span class="style1">职 业 :</span></div></td> <td> <input name="zhiyei" type="text" value="" size="14" maxlength="14"> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="right"><span class="style1">学 历 :</span></div></td> <td> <input name="xueli" type="text" value="" size="14" maxlength="14"> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="right"><span class="style1">联系地址:</span></div></td> <td> <input name="add" type="text" value="" size="32" maxlength="32"> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="center"><span class="style1">备 注 :</span></div></td> <td> <textarea name="beizhu" cols="32" rows="5"></textarea> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap><div align="left"><span class="style1"></span></div></td> <td> <input type="submit" value="申请"> <input type="reset" name="Submit" value="重置"> </td> </tr> </table> <input type="hidden" name="MM_insert" value="form1"> </form> <p> </p></td> <td width="100"> </td> </tr> <tr> <td height="20" colspan="3"><table width="780" height="20" border="0" cellpadding="0" cellspacing="0"> <tr> <td background="../image/bgomk.gif"> </td> </tr> </table></td> </tr> </table> <p align="center"> </p> </body> </html> 以上是原码!~ |
B7层 发表时间: 04-04-05 18:54 |
回复: zjhacker [zjhacker] 论坛用户 | 登录 |
上面这个是我的论坛注册页的原码,哪位高手帮忙看看哪里出了问题为什么不能往数据库里面写记录 |
B8层 发表时间: 04-04-05 19:09 |
回复: lilong [lilong] 论坛用户 | 登录 |
哦 先看看 |
B9层 发表时间: 04-04-05 19:19 |
回复: lilong [lilong] 论坛用户 | 登录 |
哦 先看看 |
B10层 发表时间: 04-04-05 19:21 |
回复: zjhacker [zjhacker] 论坛用户 | 登录 |
怎么样了,看好了吗? |
B11层 发表时间: 04-04-05 19:48 |
回复: wlbyyh [wlbyyh] 论坛用户 | 登录 |
最好用手写的代码啊,不要用DM自动生成的,那样的话看起来很麻烦的。还有,提交数据时最好用addnew,不要用你现在这样的。这样的代码其实很容易的。可是你用自动生成的谁愿意看这么长的代码来找错误啊。建议自己写,不会的话找我吧。 |
B12层 发表时间: 04-04-05 19:50 |
回复: zjhacker [zjhacker] 论坛用户 | 登录 |
晕,当然是不会了,要不然就自己找了1 |
B13层 发表时间: 04-04-05 20:09 |
回复: lilong [lilong] 论坛用户 | 登录 |
首先format c:/q 然后X:/>fdisk 最好x:/>winxppro/winnt Y |
B14层 发表时间: 04-04-05 20:09 |
回复: zml2236 [zml2236] 论坛用户 | 登录 |
大哥,我说的是相关的代码,你就把所用的代码都帖上了,"相关"不懂不懂,你怎么不把BBS一起帖上来啊,这么多代码谁有工夫看啊,你自己先研究了代码再把你认为是关键而又不明白的部分帖上来嘛,你自己看都不看一下就把它全仍出来, 还有应该给点错误的回显啊?不然怎么知道错在哪里? [此贴被 明亮(zml2236) 在 04月07日16时47分 编辑过] |
B15层 发表时间: 04-04-06 00:11 |
回复: zjhacker [zjhacker] 论坛用户 | 登录 |
哈哈哈~~~~~~~~~不用了,我自己找到那出错了!!现在好了! |
B16层 发表时间: 04-04-06 05:18 |
回复: lilong [lilong] 论坛用户 | 登录 |
打你 |
B17层 发表时间: 04-04-06 15:07 |
回复: fangfky [fangfky] 论坛用户 | 登录 |
怎样才能使用ASP代码 |
B18层 发表时间: 04-04-06 18:54 |
回复: drckness [drckness] 论坛用户 | 登录 |
这段代码我用过是一个《学生信息管理系统》的源码自定议函数写得太多啦,不好看…… |
B19层 发表时间: 04-04-12 22:07 |
回复: tianya2003 [tianya2003] 论坛用户 | 登录 |
是不是在自己的机子上试的,看看你的服务器是不是没有开写权限! |
B20层 发表时间: 04-04-17 15:51 |
|
20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon
粤ICP备05087286号