Online Voting/Polling System: A Project Report
Online Voting/Polling System: A Project Report
Online Voting/Polling System: A Project Report
A
PROJECT REPORT
on
Diploma in
PREETI SINGH
May, 2019
1|Page
Project Report on Online Voting System
Candidate Declaration
I hereby certify that the work which is being presented in the project entitled
“Online Voting/Polling System, Using PHP, CSS, HTML & MySQL” in partial
fulfilment of the requirement for the award of the Diploma in Computer Science
& Engineering, Km. Mayawati Govt. Girls Polytechnic, Badalpur GB Nagar is an
authentic record of my own work carried out under the supervision of Mr. Prem
Shankar Singh Yadav, Department of CSE KMGGP Badalpur.
The matter presented in this report has not been submitted by me for the
award of any other Diploma of this or any other university/ institute.
Preeti Singh
This is to certify that the above statement made by the candidate is correct to
the best of my knowledge.
2|Page
Project Report on Online Voting System
Certificate
This is to certify that the project report entitled “ONLINE VOTING/POLLING
SYSTEM, USING PHP, CSS, HTML & MySQL” submitted by Preeti Singh, in
partial fulfilments of the requirements for the award of Diploma in Computer
Science & Engineering at Km. Mayawati Government Girls Polytechnic,
Badalpur GB Nagar is an authentic work carried out by her under my
supervision and guidance.
3|Page
Project Report on Online Voting System
ACKNOWLEDGEMENT
I would like to express my deep and sincere gratitude to all those who helped me
to complete this project. I would like to thanks to my colleagues & friends for their well
support, with gratitude. I wish to acknowledge all of them. However, I wish to make
special mention of the following: First of all, I am very thankful to my project guide
teacher (Mr. Prem Shankar Singh Yadav) without whose guidance it was not
possible for me to make this project successful. I am heartily thankful to him for giving
me his valuable time & attention and providing me a systematic way for completing
my project on time. I must make special mention to (Mr. Prem Shankar Singh Yadav),
my project in charge for their co-operation & assistance in solving technical problem.
I would also very thankful to my teacher (Mr. Ravi Pal) who gave me full support and
I thank to my HOD (Mrs. Deepika Dubey) & all those staff who provide me their
assistance in various h/w & s/w problems encountered during course of my project. I
am also very thankful to respective Principal Sir (Mr. S.K. Singh) who gave me an
Preeti Singh
BTEUP Enrollment No.: E161023550025
BTEUP ROLL NO.:
4|Page
Project Report on Online Voting System
ABSTRACT
Voting as we all know is often associated with politics and is done more often using
the manual approach where voters queue up to vote for their choices. Manual voting
without any doubt exhibits chances of voting malpractices and other negative vices.
Those and many other reasons triggered the need to shift from the manual voting
system to a more sophisticated digitalized voting platform. Today, voting does not only
stop at politics but also extends to other areas of human endeavours such as
entertainment, sports, business, Student unions, class rooms, fashion and style and
so on and so forth. The need to migrate from manual voting system to digital voting
system has brought about efficiency, free and fair election and as well as time
utilization. Today, several digital voting systems are designed all over the world to suit
different users’ requirements and needs. Most recently, unlimited number of online
voting systems are available on different platforms which give the users the autonomy
to manipulate them to their satisfaction. But, one important thing is that, majority of
them are vendor proprietary, meaning, they serve only one purpose or two. Which is
why I take it as my responsibility to design a new online voting system which is multi-
dimensional in nature, and which would allow both the users and vendors to create
their different categories of voting. Online Voting/Polling System is the name I have
System is a multipurpose online voting system which enables the users to add from
their different categories and requirements, and to allow their fans, friends and families
as well as general audiences to have the opportunity to vote for their choices. This
project documentation. This project report is intended to include the first segment of
5|Page
Project Report on Online Voting System
the project which is the introduction of the problem, its significance, scope, and other
important points. The second segment will contain the software problem analysis
where a comprehensive literature review will be discussed, and other areas will include
the feasibility analysis and project plan. Then I will further my research by analysing
the software and hardware requirements of the project which will entail a general
description of the project. Other segments to include would be the system design
where numerous notation details would be given as well as the representation of the
various flowcharts, uses cases, dataflow diagrams and Pseudo codes. Furthermore,
an overview on the project implementation will also be discussed and finally, an in-
depth Software testing evaluation will also be taken into account, this will include
applying the various testing techniques onto the various units and modules of the
project.
6|Page
Project Report on Online Voting System
INDEX
1. Introduction………………………………………………………….
1.1. Significance of Project
1.2. Project Features
1.3. Scope of The Project
1.4. Intended Audiences
1.5. Problem Definition
1.6. Problems with The Existing Voter Registration System
1.7. Existing Online Voting System
1.8. Proposed System
2. System Analysis………………………………………………………
2.1. Objectives
2.2. Phases
2.2.1. Feasibility Analysis
2.2.2. Report Approval
2.2.3. System Analysis
2.2.4. System Design
2.2.5. Coding
2.2.6. Testing
2.2.7. Implementation
2.2.8. Maintenance
2.3. Process Description
2.4. Project Model Used
2.5. ER-Diagram
2.6. Data Flow Diagram
3. Software Requirement Specification………………………………….
3.1. Introduction of Languages Used
3.2. Software Requirements
3.3. Hardware Requirements
3.4. Front-End and Back-End
4. Data Modelling……………………………………………………………
4.1. List of Tables
4.2. Database Queries
5. Snapshots…………………………………………………………………
5.1. Admin Snapshots
5.2. Student/User Snapshots
6. Coding………………………………………………………………………
7. Future Scope………………………………………………………………
8. Conclusion…………………………………………………………………
9. References…………………………………………………………………
7|Page
Project Report on Online Voting System
1.0. INTRODUCTION
8|Page
Project Report on Online Voting System
Reduction of the costs incurred during voting time in paying the very many
clerks employed for the sake of the success of the manual system.
Check to ensure that the members who are registered are the only ones to vote.
Cases of “Dead People” voting are also minimized.
Online voting system (OVS) will require being very precise or cost cutting to
produce an effective election management system.
6. Therefore, crucial points that this (OVS) emphasizes on are listed below.
ii. This system is a lot easier to independently moderate the elections and
subsequently reinforce its transparency and fairness.
iii. Less capital, less effort, and less labour intensive, as the primary cost and
effort will focus primarily on creating, managing, and running a secure online
portal.
iv. Increased number of voters as individual will find it easier and more
convenient to vote, especially those abroad.
Considering the fact that the world is dramatically accepting this so-called trend
called Digitalization. It is very important to help people achieve their dreams. What got
me motivated is the fact that the world is gradually accepting democracy, and
democracy does not only confine itself to politics, but also spreads itself beyond
politics down to our daily activities. However, the growth of sports, entertainment,
fashion and design industry, such as movies, football, crickets, and thousands of
activities; it is also paramount that technologies are improve so that it can cater for the
needs of people. More than hundreds and thousands of awards are given every year
based on certain criteria and achievements scored by people in various fields of life.
Which is why I feel I can contribute my quota towards shaping the ethics of voting
people for recognition of their personal performances. And so, online voting is the only
platform that encourages free and fair voting. But only free and fair, but it would also
allow the millions of spectators around the world to participate in honouring their
favourite choices.
9|Page
Project Report on Online Voting System
1. To provide an overview and analysis of the existing systems and how they
different from this current system.
2. To document the type of weakness and fault found in the existing systems. This
will help me to improve my current system.
3. To identify the needs of the users and ensuring that those needs are delivered
to satisfy them.
5. To also identify areas in which improvements needs to need done for continuity
of the system and for maintenance purposes.
10 | P a g e
Project Report on Online Voting System
11 | P a g e
Project Report on Online Voting System
v. Short time provided to view the voter register: This is a very big problem since
not all people have free time during the given short period of time to check and
update the voter register.
12 | P a g e
Project Report on Online Voting System
2.1. OBJECTIVE:
Online Voting System, is a web-based application in which anyone can give his\her
vote online without going to any physical polling station.
There is a database which is maintained in which all the names of voters with
complete information is stored.
The user can register for voters on a registration site of the system visited by him
only by simply filling a registration form to register voter.
After this, their details submitted in existing databases such as those as the
Registrar of Persons, the user is then registered as a voter.
After registration, the voter has to use his unique username to login into the system
voting.
If invalid/wrong details are submitted, then the user is not registered to vote.
2.2. PHASES:
System Development Life Cycle (SDLC) mainly consists of the following 7 phases
which can be detailed: -
Preliminary Investigation: -
This is the first phase of the system development life cycle. In this phase we need to
find out the need of the client- what exactly does the client want? Before the
development of any system the important point is to know the needs, objectives and
scope of the system.
13 | P a g e
Project Report on Online Voting System
Here, I analysed and understood all the technical resources needed to develop,
purchase, install or operate the system. As by considering those I agree to the
following points:
a) Does the proposed platform possess the sufficient capacity which would allow
for future need?
b) Will the software and hardware hosts be reliable enough to cater for the needs
of this project?
c) What happen with the passage of time, can I able to meet with future technology
in order to ensure continuity of this platform?
d) Can I be able to resolve compatibility issues such as browsers, internet
information services (IIS) architecture, and technology and so on?
e) With growth of users and clients, can the system be able to absorb the stress
due to high traffic and high demand of services?
Those and many other similar or dissimilar questions were rigorously answered in
ensuring that I have a successful project development.
LEGAL FEASIBILITY:
It deals with question related to economy. It comprises of the following questions:
Control Signing
Software License Agreement
Issues related to cyber laws.
Legal issues relating to the man power contract
14 | P a g e
Project Report on Online Voting System
It deals with the various issues related to the human behaviour like:
2.2.5. Coding: -
Coding is the phase in which a developer codes using any programming languages.
Coding constitutes only 20%of the whole project and which is easier to write. The
coding work is also done in the teams; development of the system is usually done
under the modular programming style, which can be either top-down approach or
bottom-up approach.
2.2.6. Testing: -
Testing is the phase in which the system that has been developed is tested. Testing
comprises of the 60% of the overall development of the system. Testing of the system
is important aims to uncover the different errors in the system. There are various
different testing techniques that can be used for the testing of the system.
15 | P a g e
Project Report on Online Voting System
2.2.7. Implementation: -
Implementation process involved the installation of software on user’s side.
Implementation process actually depends on type of a system & various. Opting for
suitable conversion approach is a step implementation. The conversion processes are
as follows: -
Parallel Conversion
Direct Conversion Approach
Pilot Conversion Approach
Phase in Conversion Approach
2.2.3. Maintenance: -
Merely developing the system is not important but also maintenance is important. The
company that has built the system provides for some time free of cost maintenance to
the client and after that period it is usually a paid service.
Starts
Stops
Preliminary
Investigation
Implementation &
Maintenance Analysis
Testing Design
Development
/coding
16 | P a g e
Project Report on Online Voting System
PHASES: -
Incremented development slices the system functionality into increments(portions).
The unified process groups increments/iterations into phases: inception, elaboration,
construction and transition.
Requirement Specification
Operation and
Maintenance
17 | P a g e
Project Report on Online Voting System
2.5. ER-Diagram: -
The entity-relationship diagram shows the relationship between the various users and
their attributes. There is a relationship between the election commission and the voter.
The voter has different attribute to store their data to database:
1. Name-Name contains first name and last name.
2. Email address
3. Login_id
4. Password
Fname
Admin_id
Name
email Manages
Login_id
Manages
VOTER Voters
Password
Name
CANDIDATE
Fname Lname
Candidate_id Candidate_name
Candidate_position
18 | P a g e
Project Report on Online Voting System
0 Level DFD
User
Or
Administrator
System
Output
DFD Level-0
The above diagram is a 0-Level DFD that only shows the flow of data between the
various and the system. In Online Voting System the administrator is the controller of
the system and all the decisions are made by him. The administrator can handle the
entire voter and their details, voting details etc. and view details of them and he can
update that detail also.
19 | P a g e
Project Report on Online Voting System
1 Level DFD
Voter
Login
Registration
Process
Process
Voter
Information Voting Final
Checking Process Report
process
DFD Level 1
The above shown diagram is a 1-level Data Flow Diagram for the Online Voting
System. According to this DFD various process are done after login process. The
administrator can register voter. The Election Commission can register the voters and
voters can use their voting rights. The voter can view the final report after giving vote.
20 | P a g e
Project Report on Online Voting System
2 Level DFD
2.1: -
Administrator Voter
Login Login
Process
21 | P a g e
Project Report on Online Voting System
HTML
CSS
PHP
MySQL
1. HTML- It stands for Hyper Text Markup Language, which is most widely used
language on the Web to develop web pages,
2. MYSQL DBMS- It allows combination, extraction, manipulation and organization
of data in the voters’ database. It is platform independent and therefore can be
implemented and used across several such as Windows, Linux server and is
compatible with various hardware mainframes. It is fast in performance, stable
and provides business value at a low cost.
3. PHP- It is a server-side scripting language designed for web development but
also used as a general-purpose programming language. PHP code can be simply
mixed with HTML code, or it can be used in combination with various templating
engines and web frameworks.
4. CSS- It describes how HTML elements are to be displayed on screen, paper, or
in other media. CSS saves a lot of work. It can control the layout of multiple
webpages all at once. External stylesheets are stored in CSS files.
22 | P a g e
Project Report on Online Voting System
23 | P a g e
Project Report on Online Voting System
5. Data Modelling
5.1 LIST OF TABLES:
1. Tbl_Administrator
2. Tbl_Candidates
3. Tbl_Members
4. Tbl_Positions
1. Tbl_Administration
2. Tbl_Candidates
24 | P a g e
Project Report on Online Voting System
3. Tbl_Members
4. Tbl_Positions
25 | P a g e
Project Report on Online Voting System
Createdatabasepoll
CREATE TABLE IF NOT EXISTS `tbadministrators` (
`admin_id` int(5) NOT NULL AUTO_INCREMENT,
`first_name` varchar(45) NOT NULL,
`last_name` varchar(45) NOT NULL,
`email` varchar(45) NOT NULL,
`password` varchar(45) NOT NULL,
PRIMARY KEY (`admin_id`)
26 | P a g e
Project Report on Online Voting System
27 | P a g e
Project Report on Online Voting System
6. Snapshot
6.1 ADMIN SCREENSHOTS
Login Page:
Admin Username and Password is required to login into the admin zone of Online
Polling/Voting System.
Home Page:
This is the home page of admin. Here the admin can manage the candidates, manage
the positions for which the election is going to be held, see the poll results and update
the admin profile also.
28 | P a g e
Project Report on Online Voting System
Manage Administrator:
Manage Positions:
On this page admin can add new positions on which the election is going to held like
chairperson, chief minister, etc. Also the admin can delete the previously added
positions.
29 | P a g e
Project Report on Online Voting System
Manage Candidates:
By going through this page the admin can enroll the name of the candidates on
specific position for the election process. Admin can also delete the candidates
name enrolled previously.
Poll Result:
All the poll results database is stored here. Her the admin can easily see the result of
the elections on different positions.
30 | P a g e
Project Report on Online Voting System
Login Page:
If the student is already registered then he/she can easily login by his/her username
and password.
Registration Page:
All the new students will have to register first for participating in the voting process
otherwise he/she is not allowed to vote any candidate. After the registration the
student can easily login to this website to vote for his favourite candidate.
31 | P a g e
Project Report on Online Voting System
Home Page:
This is the home page of the Online Voting System. Here the user can easily vote to
any candidate by going through the particular link as well as the user can update his
profile also is required.
Current Polls:
On this page the voter can check , on which positions the election is running on and
he can give his valuable vote according to his choice.
32 | P a g e
Project Report on Online Voting System
If any registered user want to update his profile than he can easily do the changes in
his profile my going through this page.
Logout Page:
The voter can log out his account by clicking on the ‘log out’ option.
33 | P a g e
Project Report on Online Voting System
7. Coding
Index.html
<html>
<head>
<link href="css/user_styles.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="js/user.js">
</script>
</head><body style="background:url(images/AS.jpg)">
<center><img src = "images/logo" alt="site logo"></a></center><br>
<b><div style="background-color:none; min-height: 100px; font-family: Elephant;
font-weight: bold;
text-shadow: 4px 4px 3px black; font-size: 60px; color: darkred;"><marquee> Online
Polling System</marquee></div></b><br><br>
<div id="page">
<div id="header">
<h1>Student Login </h1>
<div class="news"><marquee>New polls are up and running. But they will not be up
forever! Just Login and then go to Current Polls to vote for your favourite candidates.
</marquee></div>
</div>
<div id="container">
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1"
bgcolor="#FFFFFF">
<tr>
<form name="form1" method="post" action="checklogin.php" onsubmit="return
loginValidate(this)">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="tan">
34 | P a g e
Project Report on Online Voting System
<tr>
<td width="78">Username/Email</td>
<td width="6">:</td>
<td width="294"><input name="myusername" type="text" id="myusername">
</td></tr>
<tr><td>Password</td><td>:</td>
<td><input name="mypassword" type="password" id="mypassword"></td>
</tr><tr><td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Login"></td>
</tr></table></td>
</form></tr></table>
<center>
<br>Not yet registered? <a href="registeracc.php"><b>Register Here</b></a>
</center></div>
<div id="footer">
<div class="bottom_addr">© 2019 Online Polling System. All Rights
Reserved.</div>
</div></div>
</body></html>
Index.php
<html><head>
<link href="css/user_styles.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="js/user.js">
</script>
</head><body style="background:url(images/flag.jpg)">
35 | P a g e
Project Report on Online Voting System
36 | P a g e
Project Report on Online Voting System
</td></form></tr></table>
<center>
<br>Not yet registered? <a href="registeracc.php"><b>Register Here</b></a>
</center></div>
<div id="footer">
<div class="bottom_addr">© 2019 Online Polling System. All Rights
Reserved</div>
</div></div>
</body></html>
Registration.php
<html><head>
<link href=”css/user_styles.css” rel=”stylesheet” type=”text/css” />
<script language=”JavaScript” src=”js/user.js”>
</script>
</head><body style=”background:url(images/AS.jpg)”>
37 | P a g e
Project Report on Online Voting System
//Process
if (isset($_POST[‘submit’]))
$myFirstName = addslashes( $_POST[‘firstname’] ); //prevents types of SQL
injection
$myLastName = addslashes( $_POST[‘lastname’] ); //prevents types of SQL
injection
$myEmail = $_POST[‘email’];
$myPassword = $_POST[‘password’];
38 | P a g e
Project Report on Online Voting System
Login
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1” />
<title>Polling System Access Denied</title>
<link href=”css/user_styles.css” rel=”stylesheet” type=”text/css” />
</head>
<body style=”background:url(images/vote.jpg)”>
<b><div style=”background-color:none; min-height: 100px; font-family: Elephant;
font-weight: bold;
text-shadow: 4px 4px 3px orange; font-size: 60px; color: darkred;”><marquee>
Online Polling System</marquee></div></b><br><br>
<body>
<div id=”page”>
<div id=”header”>
39 | P a g e
Project Report on Online Voting System
ob_start();
session_start();
require(‘connection.php’);
40 | P a g e
Project Report on Online Voting System
if($count==1){
// If everything checks out, you will now be forwarded to student.php
$user = mysql_fetch_assoc($result);
$_SESSION[‘member_id’] = $user[‘member_id’];
header(“location:student.php”);
}
//If the username or password is wrong, you will receive this message below.
Else {
echo “Wrong Username or Password<br><br>Return to <a
href=\”index.php\”>login</a>”;
}
ob_end_flush();
?>
</div>
<div id=”footer”>
<div class=”bottom_addr”>© 2019 Online Polling System. All Rights
Reserved.</div>
</div></div>
</body></html>
Save.php
<?php
require('connection.php');
session_start();
//If your session isn't valid, it returns you to the login screen for protection
if(empty($_SESSION['member_id'])){
header("location:access-denied.php");
}
?>
<?php
41 | P a g e
Project Report on Online Voting System
42 | P a g e
Project Report on Online Voting System
function getVote(int)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
if(confirm("Your vote is for "+int))
{
xmlhttp.open("GET","save.php?vote="+int,true);
xmlhttp.send();
}
else
{
alert("Choose another candidate ");
}
}
function getPosition(String)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
43 | P a g e
Project Report on Online Voting System
xmlhttp.open("GET","vote.php?position="+String,true);
xmlhttp.send();
}
</script>
<script type="text/javascript">
$(document).ready(function(){
var j = jQuery.noConflict();
j(document).ready(function()
{
j(".refresh").everyTime(1000,function(i){
j.ajax({
url: "admin/refresh.php",
cache: false,
success: function(html){
j(".refresh").html(html);
}
})
})
});
j('.refresh').css({color:"green"});
});
</script>
</head>
<body style="background:url(images/AS.jpg)">
<b><div style="background-color:none; min-height: 100px; font-family: Elephant;
font-weight: bold;
44 | P a g e
Project Report on Online Voting System
45 | P a g e
Project Report on Online Voting System
<tr>
<td> </td>
<td> </td></tr>
</form></table>
<table width="270" align="center">
<form>
<tr>
<th>Candidates:</th>
</tr>
<?php
//loop through all table rows
//if (mysql_num_rows($result)>0){
if (isset($_POST['Submit']))
{
while ($row=mysql_fetch_array($result)){
echo "<tr>";
echo "<td>" . $row['candidate_name']."</td>";
echo "<td><input type='radio' name='vote' value='$row[candidate_name]'
onclick='getVote(this.value)' /></td>";
echo "</tr>";
}
mysql_free_result($result);
mysql_close($link);
//}
}
else
// do nothing
?>
<tr>
46 | P a g e
Project Report on Online Voting System
<h3>NB: Click a circle under a respective candidate to cast your vote. You can't
vote more than once in a respective position. This process can not be undone so
think wisely before casting your vote.</h3>
<td> </td>
</tr></form></table></div>
<div id="footer">
<div class="bottom_addr">© 2019 Online Polling System. All Rights
Reserved.</div>
</div></div>
</body></html>
Manageprofile.php
<?php
session_start();
require('connection.php');
//If your session isn't valid, it returns you to the login screen for protection
if(empty($_SESSION['member_id'])){
header("location:access-denied.php");
}
//retrive student details from the tbmembers table
$result=mysql_query("SELECT * FROM tbMembers WHERE member_id =
'$_SESSION[member_id]'")
or die("There are no records to display ... \n" . mysql_error());
if (mysql_num_rows($result)<1){
$result = null;
}
$row = mysql_fetch_array($result);
if($row)
{
// get data from db
47 | P a g e
Project Report on Online Voting System
$stdId = $row['member_id'];
$firstName = $row['first_name'];
$lastName = $row['last_name'];
$email = $row['email'];
}
?>
<?php
// updating sql query
if (isset($_POST['update'])){
$myId = addslashes( $_GET[id]);
$myFirstName = addslashes( $_POST['firstname'] ); //prevents types of SQL
injection
$myLastName = addslashes( $_POST['lastname'] ); //prevents types of SQL
injection
$myEmail = $_POST['email'];
$myPassword = $_POST['password'];
$newpass = md5($myPassword); //This will make your password encrypted into
md5, a high security hash
$sql = mysql_query( "UPDATE tbMembers SET first_name='$myFirstName',
last_name='$myLastName', email='$myEmail', password='$newpass' WHERE
member_id = '$myId'" )
or die( mysql_error() );
// redirect back to profile
header("Location: manage-profile.php");
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Student Profile Management</title>
<link href="css/user_styles.css" rel="stylesheet" type="text/css" />
48 | P a g e
Project Report on Online Voting System
49 | P a g e
Project Report on Online Voting System
<td>Password:</td>
<td>Encrypted</td>
</tr></table></td>
<td>
<table border="0" width="620" align="center">
<CAPTION><h3>UPDATE PROFILE</h3></CAPTION>
<form action="manage-profile.php?id=<?php echo $_SESSION['member_id']; ?>"
method="post" onsubmit="return updateProfile(this)">
<table align="center">
<tr><td>First Name:</td><td><input type="text" style="background-color:#999999;
font-weight:bold;" name="firstname" maxlength="15" value=""></td></tr>
<tr><td>Last Name:</td><td><input type="text" style="background-color:#999999;
font-weight:bold;" name="lastname" maxlength="15" value=""></td></tr>
<tr><td>Email Address:</td><td><input type="text" style="background-
color:#999999; font-weight:bold;" name="email" maxlength="100"
value=""></td></tr>
<tr><td>New Password:</td><td><input type="password" style="background-
color:#999999; font-weight:bold;" name="password" maxlength="5"
value=""></td></tr>
<tr><td>Confirm New Password:</td><td><input type="password"
style="background-color:#999999; font-weight:bold;" name="ConfirmPassword"
maxlength="15" value=""></td></tr>
<tr><td> </td></td><td><input type="submit" name="update" value="Update
Profile"></td></tr></table></form></td></tr></table>
<hr>
</div>
<div id="footer">
<div class="bottom_addr">© 2019 Online Polling System. All Rights
Reserved.</div></div></div>
</body></html>
50 | P a g e
Project Report on Online Voting System
Connection.php
<?php
error_reporting(1);
mysql_connect('localhost', 'root', '') or die(mysql_error());
mysql_select_db('poll') or die(mysql_error());
?>
Logout.php
<?php
session_start();
?>
<html><head>
<link href="css/user_styles.css" rel="stylesheet" type="text/css" />
</head><body style="background:url(images/vote.jpg)">
<b><div style="background-color:none; min-height: 100px; font-family: Elephant;
font-weight: bold;
text-shadow: 4px 4px 3px orange; font-size: 60px; color: darkred;"><marquee>
Online Polling System</marquee></div></b><br><br>
<div id="page">
<div id="header">
<h1>Logged Out Successfully </h1>
<p align="center"> </p></div>
<?php
session_destroy();
?>
You have been successfully logged out.<br><br><br>
Return to <a href="index.php">Login</a>
<div id="footer">
51 | P a g e
Project Report on Online Voting System
Admin: login.html
<html><head>
<link href="css/admin_styles.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="js/admin.js">
</script>
</head><body style="background:url(images/vote.jpg)">
<b><div style="background-color:none; min-height: 100px; font-family: Elephant;
font-weight: bold;
text-shadow: 4px 4px 3px orange; font-size: 60px; color: darkred;"><marquee>
Online Polling System</marquee></div></b><br><br>
<div id="page">
<div id="header">
<h1>Administrator Login </h1>
<p align="center"> </p>
</div>
<div id="container">
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1"
background= "rgba(0,0,0,0.5)">
<tr>
<form name="form1" method="post" action="checklogin.php" onsubmit="return
loginValidate(this)">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" background=
"rgba(0,0,0,0.1)">
<tr><td width="78">Username/Email</td>
<td width="6">:</td>
52 | P a g e
Project Report on Online Voting System
Admin:accessdenied.php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Online Polling System Access Denied</title>
<link href="css/admin_styles.css" rel="stylesheet" type="text/css" />
</head>
<body style="background:url(images/vote.jpg)">
<center><img src = "images/logo" alt="site logo"></a></center><br>
<center><b><font color = "brown" size="6">Online Polling
System</font></b></center><br><br>
<body>
53 | P a g e
Project Report on Online Voting System
<div id="page">
<div id="header">
<h1>Access Denied</h1><a href="admin.php">Home</a> | <a href="manage-
admins.php">Manage Administrators</a> | <a href="positions.php">Manage
Positions</a> | <a href="candidates.php">Manage Candidates</a> | <a
href="results.php">Poll Results</a></div>
<div id="container">
<div class="err">Access Denied!</div>
<p>You don't have access to this resource. <a href="login.html">Click here</a> to
login first.</p></div>
<div id="footer">
<div class="bottom_addr">© 2019 Online Polling System.Code-
Projects</div></div></div>
</body>
</html>
Admin:index.php
<html><head>
<link href="css/admin_styles.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="js/admin.js">
</script>
</head><body style="background:url(images/flag.jpg)">
<b><div style="background-color:none; min-height: 100px; font-family: Elephant;
font-weight: bold;
text-shadow: 4px 4px 3px black; font-size: 60px; color: darkred;"><marquee
behavior="alternate"> Online Polling System</marquee></div></b><br><br>
<div id="page">
<div id="header">
<h1>Administrator Login </h1>
<p align="center"> </p></div>
<div id="container">
54 | P a g e
Project Report on Online Voting System
55 | P a g e
Project Report on Online Voting System
Admin login.php
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Online Polling System Access Denied</title>
<link href="css/admin_styles.css" rel="stylesheet" type="text/css" />
</head>
<body style="background:url(images/vote.jpg)">
<center><b><font color = "brown" size="6">Online Polling
System</font></b></center><br><br>
<body>
<div id="page">
<div id="header">
<h1>Invalid Credentials Provided </h1>
<p align="center"> </p>
</div>
<div id="container">
<?php
ini_set ("display_errors", "1");
error_reporting(E_ALL);
ob_start();
session_start();
require('../connection.php');
56 | P a g e
Project Report on Online Voting System
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$sql="SELECT * FROM $tbl_name WHERE email='$myusername' and
password='$encrypted_mypassword'" or die(mysql_error());
$result=mysql_query($sql) or die(mysql_error());
// Checking table row
$count=mysql_num_rows($result);
// If username and password is a match, the count will be 1
if($count==1){
// If everything checks out, you will now be forwarded to admin.php
$user = mysql_fetch_assoc($result);
$_SESSION['admin_id'] = $user['admin_id'];
header("location:admin.php");
}
//If the username or password is wrong, you will receive this message below.
else {
echo "Wrong Username or Password<br><br>Return to <a
href=\"login.html\">login</a>";
}
ob_end_flush();
?>
</div>
<div id="footer">
<div class="bottom_addr">© 2019 Online Polling System. All Rights
Reserved.</div>
</div></div></body>
</html>
57 | P a g e
Project Report on Online Voting System
58 | P a g e
Project Report on Online Voting System
59 | P a g e
Project Report on Online Voting System
60 | P a g e
Project Report on Online Voting System
VotingPositions.php
<?php
session_start();
require('../connection.php');
//If your session isn't valid, it returns you to the login screen for protection
if(empty($_SESSION['admin_id'])){
header("location:access-denied.php");
}
//retrive positions from the tbpositions table
$result=mysql_query("SELECT * FROM tbPositions")
or die("There are no records to display ... \n" . mysql_error());
if (mysql_num_rows($result)<1){
$result = null;
}
?>
<?php
// inserting sql query
if (isset($_POST['Submit']))
61 | P a g e
Project Report on Online Voting System
{
$newPosition = addslashes( $_POST['position'] ); //prevents types of SQL injection
$sql = mysql_query( "INSERT INTO tbPositions(position_name) VALUES
('$newPosition')" )
or die("Could not insert position at the moment". mysql_error() );
// redirect back to positions
header("Location: positions.php");
}
?>
<?php
// deleting sql query
// check if the 'id' variable is set in URL
if (isset($_GET['id']))
{
// get id value
$id = $_GET['id'];
// delete the entry
$result = mysql_query("DELETE FROM tbPositions WHERE position_id='$id'")
or die("The position does not exist ... \n");
// redirect back to positions
header("Location: positions.php");
}
else
// do nothing
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Administration Control Panel:Positions</title>
62 | P a g e
Project Report on Online Voting System
63 | P a g e
Project Report on Online Voting System
echo "<tr>";
echo "<td>" . $row['position_id']."</td>";
echo "<td>" . $row['position_name']."</td>";
echo '<td><a href="positions.php?id=' . $row['position_id'] . '">Delete
Position</a></td>';
echo "</tr>";
}
mysql_free_result($result);
mysql_close($link);
?>
</table>
<hr>
</div>
<div id="footer">
<div class="bottom_addr">© 2019 Online Polling System. All Rights
Reserved.</div></div></div>
</body></html>
Candidates.php
<?php
session_start();
require('../connection.php');
//If your session isn't valid, it returns you to the login screen for protection
if(empty($_SESSION['admin_id'])){
header("location:access-denied.php");
}
//retrive candidates from the tbcandidates table
$result=mysql_query("SELECT * FROM tbCandidates")
or die("There are no records to display ... \n" . mysql_error());
if (mysql_num_rows($result)<1){
$result = null;
64 | P a g e
Project Report on Online Voting System
}
?>
<?php
65 | P a g e
Project Report on Online Voting System
}
?>
<?php
// deleting sql query
// check if the 'id' variable is set in URL
if (isset($_GET['id']))
{
// get id value
$id = $_GET['id'];
66 | P a g e
Project Report on Online Voting System
67 | P a g e
Project Report on Online Voting System
?>
</SELECT></td></tr>
<tr><td> </td>
<td><input type="submit" name="Submit" value="Add" /></td></tr></table>
<hr>
<table border="0" width="620" align="center">
<CAPTION><h3>AVAILABLE CANDIDATES</h3></CAPTION>
<tr>
<th>Candidate ID</th>
<th>Candidate Name</th>
<th>Candidate Position</th>
</tr>
<?php
//loop through all table rows
while ($row=mysql_fetch_array($result)){
echo "<tr>";
echo "<td>" . $row['candidate_id']."</td>";
echo "<td>" . $row['candidate_name']."</td>";
echo "<td>" . $row['candidate_position']."</td>";
echo '<td><a href="candidates.php?id=' . $row['candidate_id'] . '">Delete
Candidate</a></td>';
echo "</tr>";
}
mysql_free_result($result);
mysql_close($link);
?>
</table><hr>
</div>
<div id="footer">
68 | P a g e
Project Report on Online Voting System
Result.php
<?php
require('../connection.php');
session_start();
//If your session isn't valid, it returns you to the login screen for protection
if(empty($_SESSION['admin_id'])){
header("location:access-denied.php");
}
?>
<html><head>
<script language="javascript" src="js/jquery-1.2.6.min.js"></script>
<script language="javascript" src="js/jquery.timers-1.0.0.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var j = jQuery.noConflict();
j(document).ready(function()
{
j(".refresh").everyTime(1000,function(i){
j.ajax({
url: "refresh.php",
cache: false,
success: function(html){
j(".refresh").html(html);
}
})
})
});
69 | P a g e
Project Report on Online Voting System
j('.refresh').css({color:"green"});
});
</script></head>
<body></body></html>
Admin Logout.php
<html><head>
<link href="css/admin_styles.css" rel="stylesheet" type="text/css" /></head>
<body style="background:url(images/logo.jpg)">
<b><div style="background-color:none; min-height: 100px; font-family: Elephant;
font-weight: bold;
text-shadow: 4px 4px 3px black; font-size: 60px; color: darkred;"><marquee> Online
Polling System</marquee></div></b><br><br>
<div id="page">
<div id="header">
<h1>Logged Out Successfully </h1>
<p align="center"> </p>
</div>
<?
session_start();
session_destroy();
?>
You have been successfully logged out of your control panel.<br><br><br>
Return to <a href="login.html">Login</a>
<div id="footer">
<div class="bottom_addr">© 2019 Online Polling System. All Rights
Reserved.</div>
</div></div>
</body></html>
70 | P a g e
Project Report on Online Voting System
8. FUTURE SCOPE
Well, the future of this project lies in the hand of our users. Although I also have a part
to play. This is through enhancing the features of this system by introducing concepts
and functionalities which are trending with other systems. However, maintenance is
the most important thing that determines the future of a software. By constant
maintenance, debugging and providing security checks I hope the system should be
able to survive those future challenges. One most important thing is that if this project
is able to be adopted by any college and private sectors for election purpose, then it
is going to be a remarkable achievement for the system as well as the team. This is
why I hope to re-introduce the idea of using online voting system through campaign
and promos to enlighten the general public on the importance of digitalizing elections
and all forms of voting for the betterment of the people, security, and fairness.
71 | P a g e
Project Report on Online Voting System
9. CONCLUSION
This Online Voting System is simple and indigenous. It has an authentication feature
that will manage the Voter’s information by which voter can login and use his/her voting
rights. There is a database in which all the names of voters with complete information
is stored and it provides the tools for maintaining voter’s vote to every candidate and
also computes the total number of votes of every candidate. Online voting offers speed
and convenience to the voter and considerable ease to election administrators as they
can get election results out more quickly than conventional methods of manual voting
since vote counting is just a matter of querying the database. This Online Voting
system will manage the Voter’s information by which voter can login and use his voting
rights. The system will incorporate all features of Voting system. It provides the tools
for maintaining voter’s vote to every party and it count total no. of votes of every party.
names of voter with complete information is stored. In this every user can register
his/her information on the database and when he/she want to vote he/she has to login
by his id and password and can vote to any party only single time. Voting detail store
percentage of voting is increases. It decreases the cost and time of voting process. It
is very easy to use and It is very less time consuming. It is very easy to debug.
72 | P a g e
Project Report on Online Voting System
10. Bibliography
Book reference
1. Head first PHP & MySQL
By lynn Beighley & Michael Morrison
Published by O’ Reilly Media, INC.,1005 Gravenstein Highway
North, Sebastopol, ca 95472.
2. Learning PHP, MySQL, JAVASCRIPT & CSS
By Robin Nixon (2010)
Published by O’ Reilly media, INC.,1005 Gravenstein Highway
North, Sebastopol, ca 95472.
3. Software Engineering
By Ian Sommerville (2010)
Published by O’ Reilly Media, INC.,1005 Gravenstein Highway
North, Sebastopol, ca 95472.
Website Reference:
www.tutorialpoint.com
www.w3school.com
www.studypoint.com
73 | P a g e