📄 vote_result_page.jsp
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Vote Result Page</title>
</head>
<body bgcolor="#C0C0C0" topmargin="0" background="http:\\localhost:8000\music\Background.bmp" >
<table border="0" width="100%">
<tr>
<td width="100%">
<table border="0" width="97%" height="19">
<tr>
<td width="18%" height="13" valign="middle" align="right">
<font face="Arial" size="5" color="#800000"><b><i>eMusicWorld-----> The World of Music</i></b></font>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.text.*" %>
<%@ page import="java.sql.Date" %>
<%@ page language = "java" %>
<%! int voteNum=0;%>
<%! String selSong=new String();%>
<%
selSong=request.getParameter("Song1");
selSong=selSong.trim();
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection connect;
connect=DriverManager.getConnection("jdbc:odbc:RegisterDataSource","wasiqr","bhalbabatu");
Statement state,state2;
ResultSet result1;
state = connect.createStatement();
state2 = connect.createStatement();
String strQuery1 = "update Vote_info set Number_votes=Number_votes+1 where Item_code=(select Item_Code from Item_Master where Title='"+selSong+"') ";
state.executeUpdate(strQuery1);
String strQuery2="select Number_votes from Vote_info where Item_code = (select Item_code from Item_master where Title='"+selSong+"')";
result1=state2.executeQuery(strQuery2);
while(result1.next())
{
voteNum=result1.getInt("Number_Votes");
}
connect.close();
voteNum=voteNum+1;
}
catch(Exception e)
{}
%>
<form method="GET" action="http://localhost:8000/music/home_page.htm">
<table border="1" width="100%">
<tr>
<td width="18%">
<p><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/home_page.htm">Home</a></b></font></p>
<p><b><font face="Arial" size="2" color="#800000"><a HREF="http://localhost:8000/music/chart_toppers.jsp">Chart Toppers</a></font></b></p>
<p><b><font face="Arial" size="2" color="#800000"><a HREF="http://localhost:8000/SearchContext/SearchAlias">Search</a></font></b></p>
<p><b><font face="Arial" size="2" color="#800000"><a HREF="http://localhost:8000/music/vote_page.jsp">Vote</a></font></b></p>
<p><b><font face="Arial" size="2" color="#800000"><a HREF="http://localhost:8000/music/new_release_page.jsp">New Releases</a></font></b>
<p><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/Register/RegisterPage.htm">Register</a></b></font>
<p><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/login_page.htm">Login</a></b></font>
<p><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/help_page.htm">Help</a></b></font></p>
<p> </td>
<td width="82%" valign="top">
<p align="left"><font face="Arial" size="3" color="#800000"><b><u>You voted for the song:</u></b>
<p align="left"><font face="Arial" size="3" color="#800000"><b><%=request.getParameter("Song1")%></b></font></p>
<p align="left"><%=voteNum%> <font face="Arial" size="3" color="#800000">people have voted for this song so far.</font></p>
<p> </p>
<p>
<input type="submit" value="OK" name="submit"></p>
</td>
</tr>
</table>
<p> </p>
<p> </p>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -