标题:怎么才能让这代码正确
只看楼主
quker1983
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-6-13
 问题点数:0 回复次数:1 
怎么才能让这代码正确

<!--#include file="conn.asp"-->
<%
idt=request("id")
heading=request.form("heading")
shijian=request.form("time1")
text=request.form("text")
%>
<%If heading="" then%>
<script>
alert("标题 不能为空 !");
location.href="newREN.asp";
</script>
<%else%>
<%If shijian="" then%>
<script>
alert("时间 不能为空 !");
location.href="newREN.asp";
</script>
<%else%>
<%
conn.execute("update culture set heading='"& heading &"',time='"&shijian&"',text='"&text&"' where id like '"&idt&"'")
%>
<script>
alert("更新成功!");
location.href="new.asp";
</script>
<%End if%>
<%End if%>


麻烦各位大虾!这是更新的程序.可是执行时conn.execute("update culture set heading='"& heading &"',time='"&shijian&"',text='"&text&"' where id like '"&idt&"'")
错误..可是我不知道问题出在哪里.麻烦帮我纠正下.

搜索更多相关主题的帖子: 代码 
2007-06-13 15:42
lq7350684
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:5089
专家分:98
注 册:2006-11-6
得分:0 

<!--#include file="conn.asp"-->
<%
idt=request("id")
heading=request.form("heading")
shijian=request.form("time1")
text=request.form("text")

If heading="" then
response.Write"<script>alert('标题 不能为空 !');location.href=newREN.asp;</script>"
end if
If shijian="" then
response.Write "<script>alert('时间 不能为空 !');location.href=newREN.asp;</script>"
end if

conn.execute("update culture set heading='"& heading &"',time='"&shijian&"',text='"&text&"' where id like '"&idt&"'")

response.Write "<script>alert('更新成功!');location.href="new.asp";</script>"
%>

2007-06-13 17:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-147161-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.787426 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved