VOTE.JSP

35 views
Skip to first unread message

nandu

unread,
Feb 16, 2007, 1:51:35 AM2/16/07
to Open Projects For All
<%@ page import = "java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title>Vote</title>
<meta http-equiv="content-type" content="text/
html;charset=iso-8859-2" />
<meta name="author" content="Nandu(free-css-templates.com)" />
<link rel="stylesheet" href="stylesheet.css" type="text/css" />
<title>Login </title>
</head>
<body>
<div id="content">

<div id="header">


<h1><span class="green bigl">M</span>usic<span class="green bigl">I</
span>nc</h1>
<span class="slogan">Music Inc.-Living The Music Way</span>
</div>
<right><b><font size="3" color="yellow" face="Bold" ><a
href="home.html" title="Home">HOME </a></font></b></right>
<div id="menu">
<div class="pad">

<div class="submit">
<ul>
<b><font size="3" color="yellow" face="Bold"><marquee
width="100%" height="0"> Music Inc. </marquee></font></b>
</ul>
</div>
</div>
</div>

<div id="maincontent">

<br/><br/>
<div id="rightside">
<img src="virfound.gif">

</div>


<div class="pad">
<br/>
<h2>Sign <span class="green">In</span> </h2>
<p>
<%

String songs[] = request.getParameterValues("vote");
for(int j=0;j<songs.length;j++)
out.println(""+songs[j]);
ResultSet res=null;
String str="";

try

{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;
con = DriverManager.getConnection("jdbc:odbc:myds","sa",".");
Statement stat = null;
if(songs != null && songs.length != 0)
{
for(int i=0;i<songs.length;i++)
{
if(songs[i].compareTo("Escape")==0)
{str="update vote_table set vote=vote+1 where songId=0";
stat=con.createStatement();
}
if(songs[i].compareTo("Angel")==0)
{
str="update vote_table set vote=vote+1 where songId=1";
stat=con.createStatement();
}
if(songs[i].compareTo("Grillz")==0)
{stat=con.createStatement();
}
if(songs[i].compareTo("Jam")==0)
{
str="update table vote_table set vote=vote+1 where songId=3";
stat=con.createStatement();
}
}
}
res=stat.executeQuery(str);

%><br/><br/>

<font size="5" face="Bold">Vote Casted Successfully....</font>
<br/><br/><br/>

<br /><br /><br /><br /><br /><br />
<%}
catch(Exception e)
{
out.println(""+e);
%>

<%
}
%>

<b>Not a member yet ? <a href="register.html"> JOIN NOW </a></b><br /
><br /><br/><br/><br/><br/>

</p>
</div>
</div>

</div>


<div id="footer">
<p class="right">Copyright &copy; 2006 Music Inc, : <a href="http://
www.google.com" title="Designed by Nanda Gopal P.R">Designed by
NandaGopal P.R</a></p>

</div>

</div>
</body>
</html>


VOTE.HTML
====================================

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title>Vote</title>
<meta http-equiv="content-type" content="text/
html;charset=iso-8859-2" />
<meta name="author" content="Nandu(free-css-templates.com)" />
<link rel="stylesheet" href="stylesheet.css" type="text/css" />
<title>Login </title>
</head>
<body>
<div id="content">

<div id="header">


<h1><span class="green bigl">M</span>usic<span class="green bigl">I</
span>nc</h1>
<span class="slogan">Music Inc.-Living The Music Way</span>
</div>
<right><b><font size="3" color="yellow" face="Bold" ><a
href="index.html" title="Home">HOME </a></font></b></right>
<div id="menu">
<div class="pad">

<div class="submit">
<ul>
<b><font size="3" color="yellow" face="Bold"><marquee
width="100%" height="0"> Music Inc. </marquee></font></b>
</ul>
</div>
</div>
</div>

<div id="maincontent">

<br/><br/>
<div id="rightside">
<img src="virfound.gif">

</div>


<div class="pad">
<br/>
<h2>Sign <span class="green">In</span> </h2>
<p>


<br/><br/>
<form action ="vote.jsp" method ="post">
Escape :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;<input type ="radio" name ="vote" style ="background :
url(images/input-email.jpg) top;" size = "18" ><br/><br/>

Angel &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<input type
="radio" name ="vote" style ="background : url(images/input-
email.jpg) top;" size = "18" ><br/><br/>

Grillz : &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type ="radio" name
="vote" style ="background : url(images/input-email.jpg) top;" size =
"20" ><br/><br/>
Jam : &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<input type
="radio" name ="vote" style ="background : url(images/input-
email.jpg) top;" size = "18" ><br/><br/>
<br/><br/><br/>

<input type = "submit" value ="Vote" />
<input type = "reset" value ="Reset" />

<br /><br /><br /><br /><br /><br />

<b>Not a member yet ? <a href="register.html"> JOIN NOW </a></b><br /
><br /><br/><br/><br/><br/>

</p>
</div>
</div>

</div>


<div id="footer">
<p class="right">Copyright &copy; 2006 Music Inc, : <a href="http://
www.google.com" title="Designed by Nanda Gopal P.R">Designed by
NandaGopal P.R</a></p>

</div>

</div>
</body>
</html>

Reply all
Reply to author
Forward
0 new messages