⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.asp

📁 simulink建模及动态仿真这本书上的例题的代码
💻 ASP
字号:
<!--#include file="../../forum/admin/common-admin.asp"-->
<!---all common functions and definisions--->
<%
call secure_general()
dim useraction
dim username,password,topic,secure
dim id,flag,color
useraction=request("action")
select case useraction
case "add"
username=request.form("username")
password=request.form("password")
topic=request.form("topic")
'the issecure field in the db is future option to lock a forum to registered users only
secure=0
'-----------
call connect()
sql="select forumname,username,password from myforums where forumname='"&topic&"' or password='"&password&"'"
rs.open sql,conn
if rs.eof and rs.bof then
	conn.execute("insert into myforums (forumname,username,password,isSecure) values('"&topic&"','"&username&"','"&password&"','"&secure&"')")
else
	response.write "<script>alert('Forum name/Password already exist')</script>"
end if
call close()
end select
call connect()
sql="select * from myforums order by forumid"
rs.open sql,conn
%>	
<html>
<head>
<script>
function rusure() { 

 if (confirm("Are you sure you want to delete?")) { 
return true; 
 } else { 

return false; 
 } 
} 
</script>
<style>
th{color:white}
body{background-color: white}
a{text-decoration:none;color:blue}
a:hover{text-decoration:underline;color:red}
</style>
</head>
<body align="center">
		<center><font size="5"><b><font color="#FF0000">恒润科技论坛管理界面</font> </b> </center>
<br>
<table  align="center" border=0 cellspacing=4>
<th bgcolor=black>Forum</th>
<th bgcolor=black>Username</th>
<th bgcolor=black>Password</th>
<th bgcolor=black>Update</th>
<th bgcolor=black>Delete</th>
  <%
do while not rs.eof
changeColor()
id=rs("forumid")
Response.Write "<tr bgcolor="& color &"><td>"
Response.Write rs("forumname") & "</td><td>"
Response.Write rs("username") & "</td><td>"
Response.Write rs("password") & "</td><td>"
Response.Write "<a href='editdel.asp?id="&id&"&action=edit'>Edit</td><td><a href='editdel.asp?id="&id&"&action=del'onclick='return rusure()'>Delete</td></tr>"
rs.movenext
loop
call close()
Response.Write "<tr><td><a href='../index.asp'>返回</a></tr></td></table><br><br><br><br></table>"%>
<div align="center"></div>
  <table border=0 width=341 align="center">
    <tr>
      <td colspan=2> 
        <!--list of forumname,username,password+edit/del--->
        <div align="center">请输入论坛主题和用户名及密码 </div>
      </tr></td>
    <form action="../../forum/admin/main.asp?action=add" method="post">
      <tr align=right>
        <td>用户名</td>
        <td><input type="text" name="username" size="25" maxlength="10"></tr></td>
	<tr align=right>
        <td>密&nbsp;&nbsp;码</td>
        <td><input type="password" name="password" size="25" maxlength="10"></tr></td>
	<tr align=right>
        <td>论坛主题</td>
        <td><input type="text" name="topic" size="25" maxlength="50"></tr></td>
	
	<tr align=right><td colspan=2 align=center>
	<input type="submit" name="submit">&nbsp;<input type="Reset">
		</form>
		</table>
		
<div align="center"></div></body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -