|
蓝森林 http://www.lslnet.com 2006年8月25日 8:28
SOS 请大家帮我看看这个ASP程序的问题,谢谢
SOS 请大家帮我看看这个ASP程序的问题,为什么提交不到数据库。希望UBB能够起作用,谢谢大家!! :confused:
[download=http://www.yz-daishi.com/8088.zip]新闻提交[/download] |
我大致看了以下
你声名的变量有问题!我晕!
type,time
都是 系统的!
不可以做为变量的! |
在就是,我看你哪个 时间那里可能也有问题!!!
|
jyhjyh在上个帖子中说
谢谢呀。你可以帮我改一下吗。咱也刚学ASP不久,谢谢了。 |
<!--#include file="conn.asp"-->
<%
dim title,tpe,img,contact,f_time
set rs=server.createobject("adodb.recordset")
sql="select * from news"
rs.open sql,conn,1,3
rs.addnew
rs("title")=trim(request("title"))
rs("tpe")=trim(request("tpe"))
rs("img")=trim(request("img"))
rs("contact")=trim(request("contact"))
rs("f_time")=request("f_time")
rs.update
rs.close
set rs=nothing
Response.Write("<script>alert('新闻添加成功:)!');window.location='index.asp';</script>")
%>
-----------------------------------------------------------------------------这是add_news.asp
//////////////////////////////////////////////////////////////////////////////
-------------------------------------------------------------------------------这是index.asp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>上传图片++</title>
<style type="text/css">
<!--
.c {
background-color: #f6f6f6;
border: 4px solid #996600;
}
-->
</style>
<style type="text/css">
<!--
.T {
font-family: "宋体";
font-size: 12px;
color: #996600;
}
-->
</style>
<style type="text/css">
<!--
.table {
background-color: #FFFFFF;
border: 1px solid #996600;
}
-->
</style>
</head>
<body bgcolor="#DFCEB3" leftmargin="0" topmargin="00">
<br>
<br>
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0" class="c">
<tr>
<td><form name="form1" method="post" action="add_news.asp">
<br>
<table width="98%" border="0" align="center" cellspacing="4">
<tr>
<td width="15%" height="24" align="right" bgcolor="#E0DBC9" class="T">
标 题:</td>
<td width="90%" height="24"> <input name="title" type="text" class="table">
</td>
</tr>
<tr>
<td width="15%" height="24" align="right" bgcolor="#E0DBC9" class="T">新闻类别:</td>
<td width="90%" height="24"> <select name="type" class="table">
<option value="公司新闻">公司新闻</option>
<option value="行业新闻">行业新闻</option>
<option value="最新新闻">最新新闻</option>
<option value="其它新闻">其它新闻</option>
</select> </td>
</tr>
<tr>
<td width="15%" height="24" align="right" bgcolor="#E0DBC9" class="T">上传图片:
<input type="hidden" name="img"> </td>
<td width="90%" height="24" valign="middle"> <iframe name="I1" frameborder=0 width="100%" height=30 scrolling=no src=upimg.asp></iframe></td>
</tr>
<tr>
<td width="15%" height="24" align="right" bgcolor="#E0DBC9" class="T">新闻内容:
<input type="hidden" name="contact"></td>
<td width="90%" height="250" valign="top"> <iframe name="I1" frameborder=0 width="100%" height=250 scrolling=no src=editor.html></iframe></td>
</tr>
<tr>
<td width="15%" height="24" align="right" bgcolor="#E0DBC9" class="T">发表时间:</td>
<td width="90%" height="24"> <input name="f_time" type="text" class="table" id="time" value="<%=date()%>"></td>
</tr>
<tr>
<td width="15%" bgcolor="#E0DBC9"> </td>
<td width="90%" height="30" align="center" bgcolor="#E0DBC9"> <input name="Submit" type="submit" class="table" value="提交">
<input name="Submit2" type="reset" class="table" value="重置">
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
--------------------------------------------------------------------------------还要改一下数据库字段名
我把你原来的 type 改为 tpe time改为f_time
|
楼主,你的编辑器是自己写的吗?
不知道可否给我一份啊 |
上传数据库是可以。但是没有支持UBB,是怎么回事呀。谢谢大家了。 |
如果想要的化,加我QQ:170801692。不过我的编辑器好像没起来作用,如果有人知道的化,请告诉我。谢谢。 |
我想你可以[]开始或结尾的用replace转成<>不就行了吗?
ubb现在不是很通用的.有时会出现这种情况的 |
谢谢大家的回答,不过我对ASP不是很了解,可以让mailangel123,给一段关于replace格式的代码吗。谢谢。
|
|