一个简单的添加网络音乐的程序
[ 2006-04-21 13:22:49 | 作者: kite ]
首页面
<SCRIPT LANGUAGE="VBSCRIPT">
Sub Checkdata()
If Attend.song1.Value = Empty Then
Window.Alert "“歌手”一定要填写哦..."
Exit Sub
End if
If Attend.song2.Value = Empty Then
Window.Alert "“歌名”一定要填写哦..."
Exit Sub
End if
If Attend.song3.Value = Empty Then
Window.Alert "“文件URL”一定要填写哦..."
Exit Sub
End if
If Attend.song4.Value = Empty Then
Window.Alert "“添加者”一定要填写哦..."
Exit Sub
End if
Attend.Submit
End sub
</SCRIPT>
</SCRIPT>
<style type="text/css">
<!--
.STYLE1 {
font-size: x-large;
color: #FF00FF;
}
body {
background-image: url(image/bkg.jpg);
}
-->
</style>
<body>
<form id="form1" name="Attend" method="post" action="addsong.asp">
<p> </p>
<p align="center" class="STYLE1" > 添加歌曲</p>
<table width="495" border="1" align="center" bordercolor="#0000FF">
<tr>
<td colspan="2" align="center" bgcolor="#FFFF33"> 请填入下列资料 (提示“*”字段请务必填写) </td>
</tr>
<tr>
<td width="83" align="right" bgcolor="#00FFFF">*歌手:</td>
<td width="396" bgcolor="#00FFFF"><label>
<input name="song1" type="text" size="50" value="" />
</label></td>
</tr>
<tr>
<td align="right" bgcolor="#00FFFF">*歌名:</td>
<td bgcolor="#00FFFF"><label>
<input name="song2" type="text" size="50" value="" />
</label></td>
</tr>
<tr>
<td align="right" bgcolor="#00FFFF">*文件URL:</td>
<td bgcolor="#00FFFF"><label>
<input name="song3" type="text" size="50" value="" />
</label></td>
</tr>
<tr>
<td align="right" bgcolor="#00FFFF">*添加者:</td>
<td bgcolor="#00FFFF"><label>
<input name="song4" type="text" size="50" value="">
</label></td>
</tr>
<tr>
<td height="55" align="right" bgcolor="#00FFFF">介绍:</td>
<td bgcolor="#00FFFF"><label>
<textarea name="song5" cols="50" rows="5" wrap="virtual"></textarea>
</label></td>
</tr>
<tr>
<td colspan="2" bgcolor="#00FFFF"><label>
<input name="button" type="button" onClick="Checkdata" value="提交" />
<input type="reset" name="Submit2" value="重置" />
</label></td>
</tr>
</table>
</form>
</body>
加入数据库页面
<!-- #include file="conn2.asp" -->
<%
Dim song1,song2,song3,song4,song5
dim s1,s2,s3,s4,s5,s6
s1= Request("song1")
s2= Request("song2")
s3= Request("song3")
s4= Request("song4")
s5= Request("song5")
s6= Request("song3")
set rs=server.createobject("adodb.recordset")
sql="select * from music2"
rs.open sql,conn,1,3
rs.addnew
rs("song6")=s1
rs("song7")=s2
rs("song8")=s3
rs("song9")=s4
rs("song10")=s5
rs("song11")=s6
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<HTML>
<style type="text/css">
<!--
.STYLE1 {
color: #FF00FF;
font-size: xx-large;
}
.STYLE3 {color: #FF0000}
-->
</style>
<BODY background="image/bkg.jpg">
<table width="770" border="0" align="center">
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="center"><span class="STYLE1">^○^添加歌曲成功^○^</span></td>
</tr>
<tr>
<td align="center"><font size="5"><a href="addmusic.asp">再添加</a></font><font size="5"> <A
href="javascript:window.close()">关闭本窗口</A></font> </a></td>
</tr>
</table>
</BODY>
</HTML>
conn2.asp文件
<%
Set conn = Server.CreateObject("ADODB.Connection")
Strconn="DRIVER={Microsoft Access Driver (*.mdb)}; "
Strconn=Strconn & "DBQ=" & Server.MapPath("ap04072%28.mdb")
conn.Open Strconn
%>
永久地址: http://www.jmkite.com/kite/technology/feed.asp?q=comment&id=3
<SCRIPT LANGUAGE="VBSCRIPT">
Sub Checkdata()
If Attend.song1.Value = Empty Then
Window.Alert "“歌手”一定要填写哦..."
Exit Sub
End if
If Attend.song2.Value = Empty Then
Window.Alert "“歌名”一定要填写哦..."
Exit Sub
End if
If Attend.song3.Value = Empty Then
Window.Alert "“文件URL”一定要填写哦..."
Exit Sub
End if
If Attend.song4.Value = Empty Then
Window.Alert "“添加者”一定要填写哦..."
Exit Sub
End if
Attend.Submit
End sub
</SCRIPT>
</SCRIPT>
<style type="text/css">
<!--
.STYLE1 {
font-size: x-large;
color: #FF00FF;
}
body {
background-image: url(image/bkg.jpg);
}
-->
</style>
<body>
<form id="form1" name="Attend" method="post" action="addsong.asp">
<p> </p>
<p align="center" class="STYLE1" > 添加歌曲</p>
<table width="495" border="1" align="center" bordercolor="#0000FF">
<tr>
<td colspan="2" align="center" bgcolor="#FFFF33"> 请填入下列资料 (提示“*”字段请务必填写) </td>
</tr>
<tr>
<td width="83" align="right" bgcolor="#00FFFF">*歌手:</td>
<td width="396" bgcolor="#00FFFF"><label>
<input name="song1" type="text" size="50" value="" />
</label></td>
</tr>
<tr>
<td align="right" bgcolor="#00FFFF">*歌名:</td>
<td bgcolor="#00FFFF"><label>
<input name="song2" type="text" size="50" value="" />
</label></td>
</tr>
<tr>
<td align="right" bgcolor="#00FFFF">*文件URL:</td>
<td bgcolor="#00FFFF"><label>
<input name="song3" type="text" size="50" value="" />
</label></td>
</tr>
<tr>
<td align="right" bgcolor="#00FFFF">*添加者:</td>
<td bgcolor="#00FFFF"><label>
<input name="song4" type="text" size="50" value="">
</label></td>
</tr>
<tr>
<td height="55" align="right" bgcolor="#00FFFF">介绍:</td>
<td bgcolor="#00FFFF"><label>
<textarea name="song5" cols="50" rows="5" wrap="virtual"></textarea>
</label></td>
</tr>
<tr>
<td colspan="2" bgcolor="#00FFFF"><label>
<input name="button" type="button" onClick="Checkdata" value="提交" />
<input type="reset" name="Submit2" value="重置" />
</label></td>
</tr>
</table>
</form>
</body>
加入数据库页面
<!-- #include file="conn2.asp" -->
<%
Dim song1,song2,song3,song4,song5
dim s1,s2,s3,s4,s5,s6
s1= Request("song1")
s2= Request("song2")
s3= Request("song3")
s4= Request("song4")
s5= Request("song5")
s6= Request("song3")
set rs=server.createobject("adodb.recordset")
sql="select * from music2"
rs.open sql,conn,1,3
rs.addnew
rs("song6")=s1
rs("song7")=s2
rs("song8")=s3
rs("song9")=s4
rs("song10")=s5
rs("song11")=s6
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<HTML>
<style type="text/css">
<!--
.STYLE1 {
color: #FF00FF;
font-size: xx-large;
}
.STYLE3 {color: #FF0000}
-->
</style>
<BODY background="image/bkg.jpg">
<table width="770" border="0" align="center">
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="center"><span class="STYLE1">^○^添加歌曲成功^○^</span></td>
</tr>
<tr>
<td align="center"><font size="5"><a href="addmusic.asp">再添加</a></font><font size="5"> <A
href="javascript:window.close()">关闭本窗口</A></font> </a></td>
</tr>
</table>
</BODY>
</HTML>
conn2.asp文件
<%
Set conn = Server.CreateObject("ADODB.Connection")
Strconn="DRIVER={Microsoft Access Driver (*.mdb)}; "
Strconn=Strconn & "DBQ=" & Server.MapPath("ap04072%28.mdb")
conn.Open Strconn
%>
永久地址: http://www.jmkite.com/kite/technology/feed.asp?q=comment&id=3
此文还没有评论.
您无法为这篇日志发表评论.







心月湖
青草荷塘