<%@ Language=VBScript %>
<%
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
%>
<% 'If Session(strCookieURL & "www.3rom.com") = "1369852475213" and Session("count")<10 Then %>
<!--#INCLUDE FILE="conn.asp" -->
<%
if session("Clients_id")="" then
'response.redirect "login.asp"
response.write "<script>alert ('对不起,你已超时了,请重新登录!');</script>"
Response.write("<script language=javascript>parent.location='../login.asp'</script>")
end if
'set rs=Server.createObject("adodb.Recordset")
'strSql="Select * from Class"
'rs.open strSql,conn
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>AddNews</title>
<link rel="stylesheet" type="text/css" href="style.css">
<%
dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from ANclass order by Nclassid asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("Nclass"))%>","<%= trim(rs("classid"))%>","<%= trim(rs("Nclassid"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.Nclassid.length = 0;
var locationid=locationid;
var i;
var j=0;
for (i=0;i < onecount; i++)
{ document.myform.Nclassid.style.visibility='visible';
if (subcat[i][1] == locationid)
{ j=j+1;
document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
if (j==0)
{
document.myform.Nclassid.style.visibility='hidden';
document.myform.Nclassid.options[document.myform.Nclassid.length]= new Option("无子栏目","");}
}
</script>
<script language="JavaScript">
function check(object)
{
if (myform.Title.value=="")
{
alert ("请输入标题" );
myform.Title.focus();
return false;
}
if (object.Author.value=="")
{
alert ("请输入作者名" );
myform.Author.focus();
return false;
}
if (object.Content.value=="")
{
alert ("请输入内容" );
myform.Content.focus();
return false;
}
}
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
我刚刚做好!!
还是热的!
修改:
<!--#include file=conn.asp-->
<% dim name,qq,sex,age,tel,shouji,ip,page
dim dizhi,beizhu,post,email,shijian,sexwen,username
username=request("user")
name=trim(request.form("name"))
sex=trim(request.form("sex"))
age=trim(request.form("age"))
qq=trim(request.form("qq"))
shouji=trim(request.form("shouji"))
dizhi=trim(request.form("dizhi"))
post=trim(request.form("post"))
email=trim(request.form("email"))
tel=trim(request.form("tel"))
beizhu=trim(request.form("beizhu"))
page=trim(request.form("page"))
ip=trim(request.ServerVariables("LOCAL_ADDR"))
shijian=now()
name=request("user")
%>
<% if not isnumeric(qq) or not isnumeric(age) or not isnumeric(post) then
response.write"<center>你的输入有错误!年龄,QQ和邮编都是数字吗?<br></center>"
response.write "<a href=javascript:history.back()><center>返回再来</center></a>"
response.end
end if
if sex="男" then
sexwen="先生"
else
sexwen="小姐"
end if
%>
<%
sql="update user1 set beizhu='"&beizhu &"', name='"&name&"', sex='"&sex&"' ,dizhi='"&dizhi&"',email='"&email&"',page='"&page&"',shouji='"&shouji&"',tel='"&tel&"',time1='"&shijian&"',ip1='"&ip&"',qq='"&qq&"',post='"&post&"' where name='"&username&"'"
sql1="update user1 set age="&age&" where name='"&username&"'"
conn.execute sql
conn.execute sql1
%>