Web Development PHP Microroject
Web Development PHP Microroject
MICRO-PROJECT REPORT
On
Prof .Dr.R.D.Palhade
Principal
ACKNOWLEDGEMENT
By –
Online Voting System is developed using PHP, CSS, and JavaScript. The project is
an interesting, useful project. This project contains the admin side and user side
where a user can vote for their favorite candidate. While the admin can add
candidates, see voting results, and so on.
Talking about the features of this system, the admin can manage the candidates,
view results, and check feedback. While the user can simply vote for all the
available candidates by giving some Basic Details of oneself. This system is A
Interactive Way to Solve Conventional Voting. The voters can also easily vote for
their favorite person without having to go to the voting area. Also, the admin can
easily view voting status. The design of this project is very simple so that the user
won’t find any difficulties while working on it.
History
Electronic Voting is the standard means of conducting elections using Electronic
Voting Machines, sometimes called "EVMs" in India. The use of EVMs and
electronic voting was developed and tested by the state-owned Electronics
Corporation of India and Bharat Electronics in the 1990s. They were introduced in
Indian elections between 1998 and 2001, in a phased manner. Prior to the
introduction of electronic voting, India used paper ballots and manual counting.
The paper ballots method was widely criticized because of fraudulent voting and
booth capturing, where party loyalists captured booths and stuffed them with pre-
filled fake ballots. The printed paper ballots were also more expensive, requiring
substantial post-voting resources to count hundreds of millions of individual
ballots. Embedded EVM features such as "electronically limiting the rate of casting
votes to five per minute", a security "lock-close" feature, an electronic database of
"voting signatures and thumb impressions" to confirm the identity of the voter,
conducting elections in phases over several weeks while deploying extensive
security personnel at each booth[1] have helped reduce electoral fraud and abuse,
eliminate booth capturing and create more competitive and fairer elections. Indian
EVMs are stand-alone machines built with once write, read-only memory. The
EVMs are produced with secure manufacturing practices, and by design, are self-
contained, battery-powered and lack any networking capability. They do not have
any wireless or wired internet components and interface. The M3 version of the
EVMs includes the VVPAT system.
Existing system
The EVM was designed by two professors of IIT Bombay, A.G. Rao and Ravi Poovaiah. An
EVM consists of two units, a control unit, and the balloting unit. The two units are joined by a
five-meter cable. Balloting unit facilitates voting by a voter via labeled buttons while the control
unit controls the ballot units, stores voting counts and displays the results on 7 segment LED
displays. The controller used in EVMs has its operating program etched permanently in silicon at
the time of manufacturing by the manufacturer. No one (including the manufacturer) can change
the program once the controller is manufactured. The control unit is operated by one of the
polling booth officers, while the balloting unit is operated by the voter in privacy. The officer
confirms the voter's identification then electronically activates the ballot unit to accept a new
vote. Once the voter enters the vote, the balloting unit displays the vote to the voter, records it in
its memory. A "close" command issued from the control unit by the polling booth officer
registers the vote, relocks the unit to prevent multiple votes. The process is repeated when the
next voter with a new voter ID arrives before the polling booth officer. EVMs are powered by an
ordinary 6 volt alkaline battery manufactured by Bharat Electronics Limited, Bangalore and
Electronics Corporation of India Limited, Hyderabad. This design enables the use of EVMs
throughout the country without interruptions because several parts of India do not have the
power supply and/or erratic power supply. The two units cannot work without the other. After a
poll closes on a particular election day, the units are separated and the control units moved and
stored separately in locked and guarded premises. Both units have numerous tamper-proof
protocols. Their hardware, by design, can only be programmed once at the time of their
manufacture and they cannot be reprogrammed. They do not have any wireless communication
components inside, nor any internet interface and related hardware.[34] The balloting unit has an
internal real-time clock and a protocol by which it records every input-output event with a
timestamp whenever they are connected to a battery pack.[34] The designers intentionally opted
for battery power, to prevent the possibility that the power cables might be used to interfere
with the reliablefunctioning of an EVM.
Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content
must come *after* these tags -->
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet'
type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet'
type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet'
type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed'
rel='stylesheet' type='text/css'>
<style>
.headerFont{
font-family: 'Ubuntu', sans-serif;
font-size: 24px;
}
.subFont{
font-family:
'Raleway', sans-serif;
font-size: 14px;
.specialHead{
font-family: 'Oswald', sans-serif;
}
.normalFont{
font-family: 'Roboto Condensed', sans-serif;
}
</style
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media
queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<nav class="navbar navbar-default navbarfixed-top navbar-inverse "
role="navigation">
<div class="container">
<button type="button" class="navbar-toggle" data-toggle="collapse" datatarget="#example-nav-
collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="navbar-header">
<a href="cpanel.php" class="navbar-brand headerFont textlg"><strong>eVoting</strong></a>
</div>
<div class="collapse navbar-collapse" id="example-nav-collapse">
<ul class="nav navbar-nav">
<!--
<li><a href="#featuresTab"><span
class="subFont"><strong>Features</strong></span></a></li>
<li><a href="#feedbackTab"><span
class="subFont"><strong>Feedback</strong></span></a></li>
<li><a href="#"><span
class="subFont"><strong>About</strong></span></a></li>
-->
</ul>
<button type="submit" class="btn btn-success navbar-right navbar-btn"><span
class="normalFont"><strong>AdminPanel</strong></span></button>
</div>
</div> <!-- end of container -->
</nav>
<div class="container" style="padding-top:150px;">
<div class="row">
<div class="col-sm-4"></div>
<div class="col-sm-4 text-center" style="border:2px solid gray;padding:50px;">
<?php
// Credentials
$hostname= "localhost";
$username= "root";
$password= "";
$database= "db_evoting";
// UserInput Test
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
if(empty($_POST['adminUserName']) ||
empty($_POST['adminPassword']))
{
$error= "UserName or Password is Recquired.";
}
else
{
$admin_username= test_input($_POST['adminUserName']);
$admin_password= test_input($_POST['adminPassword']);
//Establish Connection
$conn= mysqli_connect($hostname, $username, $password, $database);
//Chec
k
if(!$c
onn)
{
die("Connection Failed : ".mysqli_connect_error());
}
$sql= "SELECT * FROM db_evoting.tbl_admin WHERE
admin_username='".$admin_username."' AND
admin_password='".$admin_password."'";
$query= mysqli_query($conn, $sql);
if(mysqli_num_rows($query)==1)
{
header("location:cpanel.php");
}
else
{
$error="Sorry !! Authentication Failed";
echo "<p class='alert alert-danger'><strong>$error</strong></p>";
echo "<p class='normalFont text-primary'><strong>Your Combination of
UserName and Password is In-correct.
Better, You contact to the developer of system.</strong> </p>";
echo "<br><a href='admin.html' class='btn btn-primary'><span
class='glyphicon glyphicon-refresh'></span>
<strong>Try Again</strong></a>";
}
mysqli_close($conn);
}
?>
</div>
<div class="col-sm-4"></div>
</div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
For change password
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content
must come *after* these tags -->
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet'
type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet'
type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet'
type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed'
rel='stylesheet' type='text/css'>
<style>
.headerFont{
font-family:
'Ubuntu', sans-serif;
font-size: 24px;
}
.subFont{
font-family:
'Raleway', sans-serif;
font-size: 14px;
}
.specialHead{
font-family: 'Oswald', sans-serif;
}
.normalFont{
font-family: 'Roboto Condensed', sans-serif;
}
</style>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media
queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<nav class="navbar navbar-default navbarfixed-top navbar-inverse " role="navigation">
<div class="container">
<button type="button" class="navbar-toggle" data-toggle="collapse" datatarget="#example-nav-
collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="navbar-header">
<a href="cpanel.php" class="navbar-brand headerFont textlg"><strong>eVoting</strong></a>
</div>
<div class="collapse navbar-collapse" id="example-nav-collapse">
<ul class="nav navbar-nav">
<!--
<li><a href="#featuresTab"><span
class="subFont"><strong>Features</strong></span></a></li>
<li><a href="#feedbackTab"><span
class="subFont"><strong>Feedback</strong></span></a></li>
<li><a href="#"><span
class="subFont"><strong>About</strong></span></a></li>
-->
</ul>
<button type="submit" class="btn btn-success navbar-right navbar-btn"><span
class="normalFont"><strong>AdminPanel</strong></span></button>
</div
>
</div> <!-- end of container -->
</nav>
<div class="container" style="padding-top:100px;">
<div class="row">
<div class="col-sm-4"></div>
<div class="col-sm-4" style="border:2px solid gray;padding:50px;
<div class="page-header">
<h2 class="specialHead">Admin's Password</h2>
</div>
<form action="updatePwd.php"
method="POST">
<div class="form-group">
<label for="">Old Password</label><br>
<input type="text" name="existingPassword"
placeholder="Enter Old Password"
class="form-control"><br>
<label for="">New Password</label><br>
<input type="password" name="newPassword"
class="form-control" placeholder="Enter
New Password"><br>
<label for="">Retype Password</label><br>
<input type="password" name="retypePassword" class="form-control"
placeholder="Enter New Password Again"><br>
<button type="submit" class="btn btn-block span btnprimary "> <span
class="glyphiconglyphicon-ok"></span> Change
Password</button>
</div>
</form>
</div>
<div class="col-sm-4"></div>
</div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
Output of code:-
Conclusion
The Online voting system (OVS) also known as e-voting is a term encompassing
severaldifferent types of voting embracing both electronic means of counting
votes. Electronic votingtechnology can include punched cards, optical scan voting
systems and specialized voting kiosks(including self contained direct-recording
electronic voting systems or DRE). It can also involvetransmission of ballots and
votes via telephones, private computer networks, or the internet.Online voting is an
electronic way of choosing leaders via a web driven application. Theadvantage of
online voting over the common “queue method” is that the voters have the
choiceof voting at their own free time and there is reduced congestion.
Reference:-
https://code-projects.org/online-voting-system-in-php-with-source-code/
https://www.slideshare.net/wilsonnandasaba/project-reportonline-voting-
https://ieeexplore.ieee.org/document/6756265?reload=true
https://ieeexplore.ieee.org/abstract/document/9077751