1、急急急!ASP期末大作业 利用网页设计的常用软件工具DREAMWEAVER,采用ASP+ACCESS技术制作一个综合性的网站
可以凭借Baihi告知我们
有机会能够处理你所遇到的工作
相关的要求也能够告知我们
急急急!回ASP期末大** 利用网页**的常用答软件工具DREAM...
ES:\\
2、asp动态网页设计
很简单,用session不可以了吗
例:login.asp
<%
if session("error")<>"" then
response.write session("error") '错误信息
end if
%>
<input type="submit" name="send" <%if session("count")>3 then%> disabled="disabled" <%end if%> value="登录" /> 判断错误次数
Check.asp
if session("count")="" then '设定登录次数
session("count")=1
else
if session("count")>3 then
response.write "<script>window.history.back();</script>" '正常不会提交,但还是要防范于未然,直接返回不给提示
else
session("count")=session("count")+1
end if
end if
if request.form("name")="" then
session("error")="用户名不能为空"
response.redirect("login.asp")
response.end()
elseif request.form("password")="" then
session("error")="密码不能为空"
response.redirect("login.asp")
response.end()
end if
'判断数据库中是否有该用户名密码或是否正确
if rs.eof then
session("error")="用户名或密码错误!"
response.redirect("login.asp")
response.end()
end if
别忘登录成功清空session,以防重新
session("error")=""
session("count")=""
3、asp网页设计
首先,声明,不需要oldword及newword
数据表中,我用.Username 和 Password
传递参数,我用Username Password 和 NewPassword
<%
Set Conn=Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("bookstore.asp")+";DefaultDir=;Driver={Microsoft Access Driver (*.mdb)}; DriverId=25; FIL=MS Access; ImplicitCommitSync=Yes;MaxBufferSize=512; MaxScanRows=8; PageTimeout=5; SafeTransactions=0; Threads=3; UserCommitSync=Yes; uid=; pwd=;"
Conn.Open Connstr
%>
<%
Username=request("Username")
Password=request("Password")
NewPassword=request("NewPassword")
SQL="select * from employeeinformation where UserName='"&Username&"'"
Set Rs=conn.Execute(SQL)
If Rs.Eof Or Rs.Bof then
Response.write("用户名不存在")
Rs.close
Conn.close
Set Rs=nothing
Set Conn=nothing
Response.end
end if
If Password <> Rs("Password") then
response.write("用户密码错误")
Rs.close
Conn.close
Set Rs=nothing
Set Conn=nothing
Response.end
else
sql = "UPDATE employeeinformation set Password='"&NewPassword&"'"
Conn.execute sql
Conn.close
Response.write("用户密码已经更改<br>")
Response.write("用户名:"&Username&" 新密码:"&NewPassword)
end if
%>
4、制作ASP网页可以通过像制作HTML网页那样用设计页面所见即所得的方法设计吗?
先用工具设计好html页再往里面添加asp语句即可。
5、构架一个asp网站,设计6个网页构建的简单网站
?
6、asp网页设计中用户登录
<script language=javascript>
<!--
//验证输入
function CheckForm()
{
if(document.Login.uid.value=="")
{
alert("请输入用户名!");
document.Login.uid.focus();
return false;
}
if(document.Login.pwd.value == "")
{
alert("请输入密码!");
document.Login.pwd.focus();
return false;
}
if (document.Login.verifycode.value==""){
alert ("请输入您的验证码!");
document.Login.verifycode.focus();
return(false);
}
}
-->
</script>
//表单
FORM name="Login" action="admin_check.asp" method="post" onSubmit="return CheckForm();">
<table width="682" height="170" border="0" align="center" cellpadding="0" cellspacing="0" background="images/backlogin.jpg"class="t_table">
<tr>
<th width="134" height="100" scope="col"> </th>
<th width="53" scope="col"> </th>
<th width="84" scope="col"> </th>
<th width="100" scope="col"> </th>
<th width="111" scope="col"> </th>
<th width="44" scope="col"> </th>
</tr>
<tr>
<td height="35"> </td>
<td><span class="STYLE3">管理员:</span></td>
<td colspan="2"><input name="uid" class="inputname" type="text" id="uid" style="border: 1px solid #999999;FONT-SIZE: 9pt; height:21;width:165" size="16"></td>
<td rowspan="3"> </td>
<td> </td>
</tr>
<tr>
<td height="35"> </td>
<td><span class="STYLE3">密 码:</span></td>
<td colspan="2"><input name="pwd" class="inputpassword" type="password" id="pwd" style="border: 1px solid #999999;FONT-SIZE: 9pt; height:21;width:165" size="16"></td>
<td> </td>
</tr>
<tr>
<td height="35"> </td>
<td>验证码:</td>
<td><input name=verifycode type=text value="<%If GetCode=9999 Then Response.Write "9999"%>" maxlength=4 size=10 style="border: 1px solid #999999; FONT-SIZE: 9pt;"></td>
<td><img src=GetCode.asp></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="4" valign="middle">
<input name="button" type="image" src="images/login.gif" width="74" height="39" border="0"> <a href="../index.asp"><img src="images/quxiao.gif" width="75" height="39" border="0"></a></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="4"> </td>
<td> </td>
</tr>
</table>
</FORM>
以上的放在同一个asp文件中
//admin_check.asp
<%response.Expires = 0%>
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<%
'防SQL注入
function errsql(strget)
strcheck=strget
dim nothis(16)
nothis(0) = "net user"
nothis(1) = "xp_cmdshell"
nothis(2) = "/add"
nothis(3) = "exec%20master.dbo.xp_cmdshell"
nothis(4) = "net localgroup administrators"
nothis(5) = "select"
nothis(6) = "count"
nothis(7) = "asc"
nothis(8) = "char"
nothis(9) = "mid"
nothis(10) = "'"
nothis(11) = """"
nothis(12) = "insert"
nothis(13) = "delete"
nothis(14) = "drop"
nothis(15) = "truncate"
nothis(16) = "from"
for i=1 to ubound(nothis)
if instr(strget,nothis(i)) then
response.write "<script language=javascript>alert('输入信息含有非法字符,请重新输入!');history.go(-1);</script>"
response.End
end if
next
errsql = strcheck
end function
%>
<%
dim admin,password,webpassword
admin=errsql(trim(request("uid")))
webpassword=errsql(trim(request("pwd")))
password=md5(webpassword)
if cstr(session("getcode"))<>cstr(trim(request("verifycode"))) then
response.Write "<script LANGUAGE='javascript'>alert('请输入正确的验证码!');history.go(-1);</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from master where name='"&admin&"' and password='"&password&"' " ,conn,1,1
if not(rs.bof or rs.eof) then
if password=rs("password") then
session("admin")=trim(rs("name"))
session.Timeout=20
rs.Close
set rs=nothing
response.Redirect "index.asp"
else
response.write "<script LANGUAGE='javascript'>alert('对不起,登陆失败!');history.go(-1);</script>"
end if
else
response.write "<script LANGUAGE='javascript'>alert('用户名或密码错误!');history.go(-1);</script>"
end if
%>
上面的conn.asp是连接Access数据库的,数据库和数据库的表,自己建立没问题吧
7、设计一个ASP网页,在网页中实现网页被访问的流量统计
不是的,网站流量统计只需要在您所需要统计流量的页面文件中添加相应代码即可,这需要使用FTP工具将您的网页文件下载到本地,一般是主页文件(名称为index.html,index.htm,index.asp或者index.php),而代码通常是添加到整个页面文件的最底部。添加方法:用dreamweaver或者front page将网页文件打开,进入到代码模式,然后将统计代码添加到整个网页代码的最底部。
我一直在使用的流量统计是gostats.cn的免费版本,感觉很强大,而且你的这些问题在他们的帮助页面也有详细的教程。
8、制作ASP动态网页设计需要什么软件啊?
你只需要一个软件就够了,dreamweaver8或者dreamweaver cs3
随便百度下就可以找到地方下载,或者告诉你:
http://ks.pconline.com.cn/download.jsp
9、设计一个ASP.NET网页。
给文本框写一个前端事件就可以了
我只给思路,没有给直接给代码的习惯。CSDN上也这样,哪有这种拿来主义……
“该网页用一个TextBox控件输入内容,当内容输入完毕后,立即将输入的内容显示在标签上,并将该内容添加到下拉列表框中”
知识点一:给textbox控件onkeyup的前端事件,获取其内容显示在标签上[这个不会也不会吧?]
知识点二添加到下拉列表框中的技术点为:下拉框.options.add(new Option(text,value));
"添加一个按钮,当单击该按钮时,将下拉列表框中的每一项内容变成复选框列表中的一个选项"
知识点一:遍历下拉框的项,提取所有项的文本和值
知识点二:创建复选框组
可使用document.createElement('input')的方式动态创建复选框,但为了效率,建议使用类似于模板拼接的方式,比如:_checkboxTemp = '<input type="checkbox" id="mybox{0}" name="mybox" value="{1}" /><label for="mybox{0}">{2}</label>';
然后将提取到的文本和值替换进来,生成一个字符串。最后使用:容器.innerHTML=生成的复选框组字符串的方式去生成;这样通过减少对dom的操作使得效率更高
10、在ASP网页设计中,查询语句
sql="select * from " & xx & " where 年份='" & xx2 & "' and 院校='" & xx5 & "'"