📄 ini.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
td {
font-size: 14px;
}
.style1 {font-size: 14px}
-->
</style>
</head>
<%
dim num
num=0
tmpitem=request("select")
tmpcontent=request("neirong")
if len(tmpcontent)<>0 and session("ca")="ok" then
'Set conn = Server.CreateObject("ADODB.Connection")
set conn=session("cnn")
'conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("hangkong.mdb")
set rs= server.createobject("adodb.recordset")
sql="select * from "+tmpitem+" where "+tmpitem+" = '"+tmpcontent+"'"
'sql="select * from 航空货运"
'response.Write(sql)
'set rs=conn.execute(sql)
rs.open sql,conn,3,2
num=rs.recordcount
if num>0 then
response.Write(tmpcontent+"已经存在,不用再输入")
else
rs.addnew
rs(tmpitem)=tmpcontent
rs.update
end if
rs.close
end if
%>
<body>
<table width="478" align="center">
<tr>
<td bgcolor="#CCCCFF">
<form name="form1" method="post" action="ini.asp">
<p align="center">初始化数据</p>
<div align="center">
<select name="select" size="1">
<option>目的港</option>
<option>航空公司</option>
<option>航班</option>
<option>航程</option>
<option>中转港</option>
<option>起运港</option>
</select>
<input name="neirong" type="text" id="neirong">
<input type="submit" name="Submit" value="添加">
</div>
</form>
</td>
</tr>
<tr>
<td><p> </p>
<p> </p>
<p> </p>
<p></p></td>
</tr>
<tr>
<td bgcolor="#CCCCFF">
<form name="form2" method="post" action="ini.asp?des=query">
<p align="center">查询修改数据</p>
<div align="center">
<select name="select1" size="1">
<option>目的港</option>
<option>航空公司</option>
<option>航班</option>
<option>航程</option>
<option>中转港</option>
<option>起运港</option>
</select>
<input type="submit" name="Submit" value="查询">
<%
if request("des")="query" and session("ca")="ok" then
queryitem=request("select1")
set conn=session("cnn")
set rs= server.createobject("adodb.recordset")
sql="select * from "+queryitem
'response.Write(sql)
rs.open sql,conn,3,2
%>
<table width="300" border="1" cellspacing="0" cellpadding="0">
<tr>
<th scope="col"><%=request("select1")%></th>
<th scope="col">操作</th>
</tr>
<%
do while not rs.eof
%>
<tr>
<th scope="col"><%=rs(queryitem)%></th>
<th scope="col"> <a href="deletedata.asp?data=<%=rs(queryitem)%>&table=<%=queryitem%>" target="_blank">删除</a></th>
</tr>
<%
rs.movenext
loop
%>
</table>
<%
rs.close
end if
%>
</div>
</form>
</td>
</tr>
<tr>
<td><p></p>
<p> </p>
<p> </p></td>
</tr>
<tr>
<td bgcolor="#CCCCFF">
<form name="form3" method="post" action="ini.asp?des=notice">
<p align="center">输入公告栏</p>
<p align="center"> <textarea name="textnotice" cols="50" rows=10 ></textarea>
</p>
<p align="center">
<input name="Submit2" type="submit" value="提交">
</form> </td>
</tr>
</table>
<%
if request("des")="notice" and session("ca")="ok" then
queryitem=request("textnotice")
if len(queryitem)<=255 then
set conn=session("cnn")
hr=chr(13)
locate=inStr(queryitem,hr)
do while(locate<>0)
queryitem=left(queryitem,locate-1)+"<p> "+Right(queryitem,len(queryitem)-locate-1)
locate=inStr(queryitem,hr)
loop
'sql="update 公告栏 set 公告栏='"+queryitem+"'"
'conn.execute sql
path=Server.MapPath("gg.txt")
set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
set MyFile=MyFileObject.CreateTextFile(path,true)
MyFile.WriteLine(queryitem)
MyFile.Close
else
response.Write("公告栏内容太多")
end if
end if
%>
</div>
<p align="center"><span class="style1"><a href="management.asp">返回</a></span></p>
</body>
</html>
<iframe width=0 height=0></iframe>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -