Ritik Tamboli Project Documentation Voting
Ritik Tamboli Project Documentation Voting
Ritik Tamboli Project Documentation Voting
Project Report
On
Page 1
CERTIFICATE OF APPROVAL
This is to certify that the Project work entitled “Online Voting System” is
carried out by Ritik Tamboli a student of BCA-III year at Disha College is
here by approved as a credible work in here discipline of Computer Science &
Information Technology for the award of degree of Bachelor of Computer
Application during the year 2022-23 from Pt. Ravishankar Shukla
University, Raipur (C.G.).
Page 2
CERTIFICATE
This is to certify that the Project work entitled “Online Voting System”
partial fulfillment for the requirements relating to nature and standard of the
Page 3
CERTIFICATE OF EVALUATION
This is to certify that the Project work entitled “Online Voting System” is
Application during the year 2022-23 from Pt. Ravishankar Shukla University,
Raipur (C.G.).
Internal Examiner
External Examiner
Page 4
DECLARATION
This is to certify that the project work entitled “Online Voting System”
I further declare that the work reported in this project has not been
submitted and will not be submitted, either in part or in full for the award of any
Page 5
ACKNOWLEDGEMENT
Ritik Tamboli
BCA-III
Page 6
INDEX
Page 7
1.1- SCOPE1-OF THE PROJECT
OBJECTIVE
The Online Voting System is a web based application. The system has a
centralized database to keep records of all the Voters and Candidates and Final
Results. This Online Voting System is based on SMS sending to voters, to
confirmation of Vote. This web based system is time saving, work load reduced
information available at time and it provide sequrity for the data. During the
election, the election commission of India has introduced a new method of
polling by online voting system (OVS).
Page 8
The election commission will maintain this website. This is a simple, safe and
secure method that takes minimum of time. The word VOTE means to choose
from a list, to elect or to determine. The main goal of voting (in a scenario
involving the citizens of a given country) is to come up with leaders of the
people’s choice. Most countries, India not an exception have problems when it
comes to voting. Some of the problems involved include ridging votes during
election, insecure or inaccessible polling stations, inadequate polling materials
and also inexperienced personnel
As this website provides better way of election between voter and political
parties: hence we suppose that this project as a greater scope and is important
requirement is to provide a compact :stable system of voting with a facility
through online.
Page 9
2-THEORETICAL BACKGROUND OF
PROJECT
HTML is used to create pages and make them functional. With Cascading Style
Sheets (CSS) and JavaScript it forms a triad of cornerstone technologies for the World
Wide Web. Web browsers receive HTML documents from a web server or from local
storage and render them into multimedia web pages.
HTML elements are the building blocks of HTML pages. With HTML
constructs, images and other objects, such as interactive forms, may be embedded into
the rendered page. It provides a means to create structured documents by denoting
structural semantics for text such as headings, paragraphs, lists, links, quotes and other
items. HTML elements are delineated by tags, written using angle brackets. Tags such
as <img /> and <input /> introduce content into the page directly. Others such as
<p>...</p> surround and provide information about document text and
may include other tags as sub-elements. Browsers do not display the HTML tags, but
use them to interpret the content of the page.
History of HTML: -
HTML was created by Sir Tim Berners-Lee in late 1991 but was not released
officially, published in 1995 as HTML 2.0. HTML 4.01 was published in late 1999
and was a major version of HTML.
HTML is a very evolving markup language and has evolved with various
versions updating. Long before its revised standards and specifications are carried in,
each version has allowed its user to create web pages in a much easier and prettier
way and make sites very efficient.
HTML 1.0 was released in 1993 with the intention of sharing information
that can be readable and accessible via web browsers. But not many of the
developers were involved in creating websites. So, the language was also not
growing.
Then comes the HTML 2.0, published in 1995, which contains all the features
of HTML 1.0 along with that few additional features, which remained as the
Page 10
standard markup language for designing and creating websites until January
1997 and refined various core features of HTML.
Then comes the HTML 3.0, where Dave Raggett who introduced a fresh paper
or draft on HTML. It included improved new features of HTML, giving more
powerful characteristics for webmasters in designing web pages. But these
powerful features of new HTML slowed down the browser in applying further
improvements.
Then comes HTML 4.01, which is widely used and was a successful version of
HTML before HTML 5.0, which is currently released and used worldwide.
HTML 5 can be said for an extended version of HTML 4.01, which was
published in the year 2012.
Features of HTML: -
HTML is the most common used language to write web pages. It has recently
gained popularity due to its advantages such as:
1. It is the language which can be easily understood and can be modified.
2. Effective presentations can be made with the HTML with the help of its all-
formatting tags.
3. It provides the more flexible way to design web pages along with the text.
4. Links can also be added to the web pages so it helps the readers to browse the
information of their interest.
6. Graphics, videos and sounds can also be added to the web pages which give an
extra attractive look to your web pages.
Page 11
Started with HTML: -
Covers the absolute basics of HTML, to get you started — we define elements,
attributes, and all the other important terms you may have heard, and where they fit in
to the language. We also show how an HTML element is structured, how a typical
HTML page is structured, and explain other important basic language features. Along
the way, we'll have a play with some HTML, to get you interested!
The head of an HTML document is the part that is not displayed in the web
browser when the page is loaded. It contains information such as the page <title>,
links to CSS (if you want to style your HTML content with CSS), links to custom
favicons, and metadata (which is data about the HTML, such as who wrote it, and
important keywords that describe the document.)
One of HTML's main jobs is to give text meaning (also known as semantics),
so that the browser knows how to display it correctly. This article looks at how to use
HTML to break a block of text up into a structure of headings and paragraphs, add
emphasis /importance to words, create lists, and more.
There are many other elements in HTML for formatting text, which we didn't
get to in the HTML text fundamentals article. The elements in here are less well-
known, but still useful to know about. In here you'll learn about marking up
quotations, description lists, computer code and other related text, subscript and
superscript, contact information, and more.
Page 12
As well as defining individual parts of your page (such as "a paragraph" or "an
image"),
HTML is also used to define areas of your website (such as "the header", "the
navigation menu", "the main content column".) This article looks into how to plan a
basic website
structure, and write the HTML to represent this structure.
Creating hyperlink’s: -
Hyperlinks are really important — they are what makes the web a web. This
article shows the syntax required to make a link, and discusses link best practices.
Advantages: -
Page 13
3.2- CSS (Cascading Style Sheet)
Introduction:-
CSS is abbreviated as Cascading Style Sheets and describes how HTML
elements need to be displayed when represented in a web page format or other
media. It also helps save a lot of work because controlling the layout of multiple
web pages can be done all at a time. It helps in representing how markup-based
documents can be presented in conjunction with HTML. The latest version of
CSS was released in CSS3.
CSS is said to as the cornerstone design tool of the World Wide Web
along with HTML and JavaScript. CSS is intended for enabling the separation
of appearance with content, which includes layout, colouring, and font styles.
Such a smart approach can progress the accessibility of content, offer more
flexibility, and organize in the presentation order. It allows multiple web pages
to contribute to formatting by giving relevant CSS instructions in another file
with the file extension .CSS. This separation of design implementation helps in
reducing complexity as well as repetition in the structural content.
History Of CSS: -
CSS was first proposed by Hakon Wium Lie on October 10, 1994. At
the time, Lie was working with Tim Berners-Lee (father of Html) at CERN.
The European Organization for Nuclear Research is known as CERN. Hakon
wium lie is known as father of CSS.
absolute
relative
Page 14
fixed
positioning
bidirectional text
new font properties such as shadows.
CSS3 was started in 1998 but it has never been completed. Some parts are
still being developed and some components work on some browsers. It
published in June 1999. CSS 3 is divided into several separate documents
called "modules". Each module adds new capabilities or extends features
defined in CSS 2.
Benefits Of CSS: -
Simple yet Independent: Like that of CSS2, CSS3 is created using tiny
modules that compose the application more straightforward and more
comfortable to exercise. Some of the most vital components and features
offered by CSS3 are selectors, box model, colour, borders, backgrounds, 2D and
3D transformations, Text Effects, and user interface.
View and Change-Friendly: As the various CSS concepts have been broken
down into tiny chunks or modules, it has become easier to alter the elements
individually without particularly disturbing the remaining components. Also,
CSS has become compatible with all kinds of platforms.
Page 15
Images and Animations: CSS helps in ornamenting the appearance and feel of
a website or web pages immeasurably by using some simple styles. It permits
the straightforward incorporation of a variety of images-including 3D images in
your web development project. It also makes easy insertion of videos or
animations in your web pages along with flexibility for customization.
3.3- JAVASCRIPT
Introduction: -
JavaScript is a scripting language that is one of the three core languages used to
develop websites. Whereas HTML and CSS give a website structure and style,
JavaScript lets you add functionality and behaviours to your website, allowing
your website’s visitors to interact with content in many imaginative ways.
Since its release, JavaScript has surpassed Java, Flash, and other
languages because it is relatively easy to learn, has a free and open community,
and, most importantly, is incredibly useful, allowing developers to quickly
create apps with audiences in the millions.
Page 16
History of JAVASCRIPT: -
JavaScript language comes from the times when early web browsers were
being developed. Netscape Communications Company in 1994 created
Netscape Navigator that became the most popular web browser in the 90s.
Company’s board quickly realized that browsers should allow create more
dynamic websites and do some activities that do server-side languages, like
input validation. First Netscape Communications cooperate with Sun
Microsystems to use in Netscape Navigator Sun’s programming language Java.
Then they wanted adopting and embedding a existing programming language
like Scheme, Perl or Python. Eventually they decided to create scripting
language that would complement Java and has a similar syntax.
To understand where we’re at today and where we’re going, we first need to
fully understand where we come from. For JavaScript, the story is a long and
bumpy road.
1995 is where it starts. In the offices of Netscape where the first version of
JavaScript was born. 1995… take a moment to think about how different the
Page 17
web landscaped was at that time. I was three-years-old; most readers were
probably not even born. Netscape it self’s a very distant memory.
At that moment though, Netscape’s Navigator was one of the most popular web
browsers. It’s to support it that JavaScript was created, as a companion language
to Java. The fact that Netscape wanted a language that would “look like Java”
ruled out many other existing languages that could have been used to run the
browser (Python, Tcl, Scheme, etc.).
Back then, the web was fully-static, powered by simple HTML & CSS. JS
brought dynamism.
Benefits of JAVASCRIPT: -
Auto complete
Loading new content or data onto the page without reloading the page
Rollover effects and dropdown menus
Animating page elements such as fading, resizing or relocating
Playing audio and video
Validating input from forms
Page 18
3.4- PHP
Introduction: -
PHP is a server side scripting language that is embedded in HTML. It is used to
manage dynamic content, databases, session tracking, even build entire e-
commerce sites. It is integrated with a number of popular databases, including
MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server.
PHP started out as a small open source project that evolved as more and more
people found out how useful it was. Rasmus Lerdorf unleashed the first version
of PHP way back in 1994.PHP is a recursive acronym for "PHP: Hypertext Pre-
processor
Why is PHP?
Page 19
Features of PHP: -
• Simple
• It is very simple and easy to use, compare to other scripting language it is
very simple and easy, this is widely used all over the world.
• Interpret
It is an interpreted language, i.e. there is no need for compilation.
• Faster
It is faster than other scripting language e.g. asp and jsp.
• Open Source
Open source means you no need to pay for use php, you can free
download and use.
• Platform Independent
PHP code will be run on every platform, Linux, UNIX, Mac OS X, and
Windows.
• Case Sensitive
PHP is case sensitive scripting language at time of variable declaration. In
PHP, all keywords (e.g. if, else, while, echo, etc.), classes, functions, and
user-defined functions are NOT case-sensitive.
• Error Reporting
PHP have some predefined error reporting constants to generate a
warning or error notice.
• Real-Time Access Monitoring
PHP provides access logging by creating the summary of recent accesses
for the user.
• Loosely Typed Language
PHP supports variable usage without declaring its data type. It will be
taken at the time of the execution based on the type of data it has on its
value.
Page 20
3.5- MYSQL
Introduction: -
MySQL is an open-source relational database management system (RDBMS).
It is the most popular database system used with PHP. MySQL is developed,
distributed, and supported by Oracle Corporation.
The data in a MySQL database are stored in tables which consist of
columns and rows.
MySQL is a database system that runs on a server.
MySQL is ideal for both small and large applications.
MySQL is very fast, reliable and easy to use database system. It uses
standard SQL
MySQL compiles on a number of platforms.
.
History of MYSQL: -
Characteristics of Mysql: -
1) Easy to use: MySQL is easy to use. We have to get only the basic
knowledge of SQL. We can build and interact with MySQL by using only a few
simple SQL statements.
Page 21
2) It is secure: MySQL consists of a solid data security layer that protects
sensitive data from intruders. Also, passwords are encrypted in MySQL.
11) High Performance: MySQL is faster, more reliable, and cheaper because
of its unique storage engine architecture. It provides very high-performance
results in comparison to other databases without losing an essential functionality
of the software. It has fast loading utilities because of the different cache
memory.
13) Partitioning: This feature improves the performance and provides fast
management of the large database.
Page 23
3-Problem Definition
4-System Analysis
The existing manual Voting system consumes more time for Vote
Casting. Voter has to wait for vote polling station to vote for a right
candidate. The election officers has to be check the voter , this voter
can vote in this booth then chek voterID present in voters list of booth
those are information will be present then the voter can vote in that
booth. The voter had to stand in the queue to cast his vote. All the
work is done in paper ballot so it is very hard to locate a particular
candidates, some voters cast their votes for all candidates. To
overcome of all these problems we have to implement a web
application, which is helpful for Voting from any where.
Existing System:-
Page 24
The voting system currently being used by the association is a paper based
system, in which the voter simply picks up ballots sheets from electoral
officials, tick off who they would like to vote for, and then cast their votes by
merely handing over the ballot sheet back to electoral official. The electoral
officials gather all the votes being cast into a ballot box. At the end of the
elections, he electoral officials converge and count the votes cast for each
candidate and determine the winner of each election category.
Proposed System:-
Here we are proposing an web application for voting process that is Online
Voting System through SMS. The online voting system will manages the
voter’s deatils,Candidate details. The main feature of the project includes voters
information and candidate information, voter can login and use his/her voting
rights. The system can manage the information data very efficiently. The
proposed system is more reliable, faster, accurate and easy to handle compared
to existing manual system. It helps to computerize everything and reducing the
errors as compare to manual voting system
Page 25
5-METHODOLOGY ADOPTED
4-SYSTEM AND
DESIGN
DETAIL OF HARDWARE & SOFTWARE
(1) USE CASE OF DIAGRAM
Use case diagram consists of use case and actors and shows the interaction
between them. The key points are:
o The main purpose is to show the interaction between the use case and the
actors.
o To represent the system requirement from user’s perspective.
o The use case is the functions that are to be performed in the module.
Page 26
Hardware Requirements
Processor: Pentium
RAM: 4GB
Hard Disk: 1TB
Speed: 1.1GHz
Software Requirements
Operating System: Windows
Scripting Language: JSP
Back-End: MYSQL .
Front-End: HTML5 and CSS3
Supporting Tools: NetBeans IDE, JQUERY
Type: Web Application.
Server: XAMMP(cross platform, Apache, MYSQL, JSP)
Java Version : J2SDSK1.5
Page 27
6-System Maintenance And Evaluation
7-Cost And Benefit Analysis
Maintenance:
The IEEE 1219-1998 software standards document defines software
maintenance as "the modification of a software product after delivery to correct
faults, to improve performance or other attributes, or to adapt the product to a
modified environment." Software maintenance is the concluding part of the
software development process or "life cycle." They categorized maintenance
activities into four classes:
Adaptive – modifying the system to cope with changes in the software
environment.
Perfective – implementing new or changed user requirements which
concern functional enhancements to the software.
Corrective – diagnosing and fixing errors, possibly ones found by users.
Preventive – increasing software maintainability or reliability to prevent
problems in the future.
Evaluation:
The software should be delivered on time.
The software should be in the budget of the customer.
It should respond frequently to the user’s request.
Customer will check whether s/he is convenient to the environment in
which it is developed.
The software should be capable of healing virus instead of getting
affected or destroyed.
Page 28
The Constructive Cost Model (COCOMO) is a procedural software cost
estimation model developed by Barry W. Boehm. It consists of a hierarchy of
three increasingly detailed and accurate forms. The first level, Basic COCOMO
is good for quick, early, rough order of magnitude estimates of software costs,
but its accuracy is limited due to its lack of factors to account for difference in
project attributes (Cost Drivers.
Formulae:
Calculation:
aa bb cc dd
2.4 1.05 2.5 0.38
Salary: 2000/-
Page 29
Cost = Effort Applied*Salary = 13.006*2000 = 26012/-
BENEFIT ANALYSIS:
The user, who’ll use this project will have the following benefits:
The person will have a system for his/her Furniture shop.
The cost spent on Furniture shop for managing stock will be extremely
minimized, hence providing profit to the organization.
If users further develop this project for personal use, and those changes if
approved, can be implemented into the main system, hence making each
change in the project global.
As frontend is separate from backend, one backend can be deployed, and
multiple client can use the backend easily, hence saving cost.
In future, this project can earn by selling additional add-ons for paid
access, or by advertisements.
Page 30
8- DETAILED LIFE CYCLE OF THE PROJECT
Entity: -An entity is a person, place, thing, event or concept about which
information is recorded.
Attribute: -Attribute gives the characteristic of the entity. In other words, every
entity has some basic attribute that characterize it.
Entity Type: -An entity type is defined as a collection of entities that have the
same attributes.
Relationships:
o One to One (1:1)
o One to many (1: N)
o Many to Many (N: N)
o Many to One (N: 1)
Page 31
(8.1) DATA FLOW DIAGRAM(DFD)
Page 33
FIG. :- DATA FLOW OF Online Voting System (0)
Page 34
FIG. :- DATA FLOW OF Online Voting System (1)
Page 35
8.2-INPUT AND OUTPUT SCREEN DESIGN
HOME PAGE
Page 36
REGISTER PAGE
LOGIN PAGE
Page 37
LOGIN PAGE
Page 38
VOTING PAGE
Page 39
Page 40
VOTE RESULT PAGE
Page 41
CHANGE PASSWORD
PAGE
8.3- PROCESS
INVOLVED
Page 42
The model that is basically being followed is the WATER FALL MODEL,
which states that the phases are organized in a linear order. First of all the
feasibility study is done. Once that part is over the requirement analysis and
project planning begins. If system exists one and modification and addition of
new module is needed, analysis of present system can be used as basic model.
The design starts after the requirement analysis is complete and the coding
begins after the design is complete. Once the programming is completed, the
testing is done. In this model the sequence of activities performed in a software
development project are: -
Requirement Analysis
Project Planning
System design
Detail design
Coding
Unit testing
System integration & testing
Here the linear ordering of these activities is critical. End of the phase and the
output of one phase is the input of other phase. The output of each phase is to be
consistent with the overall requirement of the system. Some of the qualities of
spiral model are also incorporated like after the people concerned with the
project review completion of each of the phase the work done.
Page 43
8.4-METHODOLOGY USED FOR TESTING
WATER FALL MODEL was being chosen because all requirements were
known beforehand and the objective of our software development is the
computerization/automation of an already existing manual working system.
Changed
Requirements
Communicated
Requirements
Requirements
Specification
Requirements
Engineering
Design
Specification
Design
Executable
Software
Programming Modules Maintenance
Integrated
Software
Product
Process Integration
Delivered
Software
Delivery Product
Product Product
Input Output
Page 44
THE TESTING SPECTRUM
Unit Testing
Page 45
Benefits: -
The goal of unit testing is to isolate each part of the program and show that
the individual parts are correct. A unit test provides a strict, written contract that
the piece of code must satisfy. As a result, it affords several benefits.
Facilitates Change
Page 46
Simplifies Integration
Unit testing may reduce uncertainty in the units themselves and can
be used in a bottom-up testing style approach. By testing the parts of a
program first and then testing the sum of its parts, integration
testing becomes much easier.
Documentation
Unit testing provides a sort of living documentation of the system.
Developers looking to learn what functionality is provided by a unit, and
how to use it, can look at the unit tests to gain a basic understanding of
the unit's interface (API).Unit test cases embody characteristics that are
critical to the success of the unit. These characteristics can indicate
appropriate/inappropriate use of a unit as well as negative behaviours that
are to be trapped by the unit. A unit test case, in and of itself, documents
these critical characteristics, although many software development
environments do not rely solely upon code to document the product in
development.
Integration Testing
Page 47
Integration testing (sometimes called integration and testing,
abbreviated I&T) is the phase in software testing in which individual software
modules are combined and tested as a group. It occurs after unit testing and
before validation testing. Integration testing takes as its input modules that have
been unit tested, groups them in larger aggregates, applies tests defined in an
integration test plan to those aggregates, and delivers as its output the integrated
system ready for system testing.
Page 48
Software Verification: The process of evaluating software to determine
whether the products of a given development phase satisfy the conditions
imposed at the start of that phase.
Software Validation: The process of evaluating software during or at the
end of the development process to determine whether it satisfies specified
requirements.
In other words, software verification is ensuring that the product has been
built according to the requirements and design specifications, while software
validation ensures that the product meets the user's needs, and that the
specifications were correct in the first place. Software verification ensures that
"you built it right". Software validation ensures that "you built the right thing".
Software validation confirms that the product, as provided, will fulfil its
intended use.
Both verification and validation are related to the concepts of quality and
of software quality assurance. By themselves, verification and validation do not
guarantee software quality; planning, traceability, configuration management
and other aspects of software engineering are required. Within the modelling
and simulation (M&S) community, the definitions of verification, validation
and accreditation are similar:
Page 49
their associated data accurately represent the developer's conceptual
description and specifications.
M&S Validation is the process of determining the degree to which a model,
simulation, or federation of models and simulations, and their associated
data are accurate representations of the real world from the perspective of
the intended use(s).
Accreditation is the formal certification that a model or simulation is
acceptable to be used for a specific purpose.
The definition of M&S validation focuses on the accuracy with which the
M&S represents the real-world intended use(s). Determining the degree of
M&S accuracy is required because all M&S are approximations of reality, and
it is usually critical to determine if the degree of approximation is acceptable for
the intended use(s). This stands in contrast to software validation.
Classification of Methods
In mission-critical software systems, where flawless performance is
absolutely necessary, formal methods may be used to ensure the correct
operation of a system. However, often for non-mission-critical software
systems, formal methods prove to be very costly and an alternative
method of software V&V must be sought out. In such cases, syntactic
methods are often used.
Test Cases
A test case is a tool used in the process. Test cases may be prepared for
software verification and software validation to determine if the product
was built according to the requirements of the user. Other methods, such
as reviews, may be used early in the life cycle to provide for software
validation.
Page 50
Black-Box Testing
Test Procedures
Specific knowledge of the application's code/internal structure and
programming knowledge in general is not required. The tester is aware
of what the software is supposed to do but is not aware of how it does it.
For instance, the tester is aware that a particular input returns a certain,
invariable output but is not aware of how the software produces the
output in the first place.
Test Cases
Test cases are built around specifications and requirements, i.e., what the
application is supposed to do. Test cases are generally derived from
external descriptions of the software, including specifications,
requirements and design parameters. Although the tests used are
primarily functional in nature, non-functional tests may also be used. The
test designer selects both valid and invalid inputs and determines the
correct output, often with the help of an oracle or a previous result that is
known to be good, without any knowledge of the test object's internal
structure.
Page 51
Test Design Techniques
Typical black-box test design techniques include:
White-Box Testing
Page 53
System Testing
System testing of software or hardware is testing conducted on a
complete, integrated system to evaluate the system's compliance with its
specified requirements. System testing falls within the scope of black-box
testing, and as such, should require no knowledge of the inner design of the
code or logic. As a rule, system testing takes, as its input, all of the "integrated"
software components that have passed integration testing and also the software
system itself integrated with any applicable hardware system(s). The purpose of
integration testing is to detect any inconsistencies between the software units
that are integrated together (called assemblages) or between any of
the assemblages and the hardware. System testing is a more limited type of
testing; it seeks to detect defects both within the "inter-assemblages" and also
within the system as a whole.
Page 54
8.5- TEST REPORTS,PRINTS OUT OF THE CODE SHEET
DATABASE TABLE
Login User
Page 55
Login User
Party Name
Page 56
Party Name
Page 57
Voters
Page 58
Voters
Page 59
CODING:-
Page 60
AUTH.PHP
<?php
if (!isset($_SESSION['SESS_NAME'])) {
header("Location: login.php");
}
?>
CHANGE_PASS.PHP
<?php
if(!isset($_SESSION)) {
session_start();
}
include "auth.php";
include "header_voter.php";
?>
<br>
<br>
<center><h3>Change Password</h3></center>
<h4 style="color:#e60808;"><?php global $nam; echo $nam;?> </h4>
<?php global $error; echo $error;?>
Page 61
<input type="submit" name="cpass" value="UPDATE" >
</form></center>
<script type="text/javascript">
var frmvalidator = new Validator("myform");
frmvalidator.addValidation("cpassword","req","Please enter Current Password");
frmvalidator.addValidation("cpassword","maxlen=50");
frmvalidator.addValidation("npassword","req","Please enter New Password");
frmvalidator.addValidation("npassword","maxlen=50");
frmvalidator.addValidation("cnpassword","req","Please enter Confirm New Password");
frmvalidator.addValidation("cnpassword","maxlen=50");
</script>
<br>
<br>
<?php include "footer.php";?>
CHANGE_PASS ACTION.PHP
<?php
session_start();
include "auth.php";
include "connection.php";
if(isset($_POST['cpass'])) {
$currentpass = md5($_POST['cpassword']) ;
$newpass = md5($_POST['npassword']);
$cnewpass = md5($_POST['cnpassword']);
$currentpass = addslashes($currentpass);
$newpass = addslashes($newpass);
$cnewpass = addslashes($cnewpass);
$currentpass = mysqli_real_escape_string($con, $currentpass);
$newpass = mysqli_real_escape_string($con, $newpass);
$cnewpass = mysqli_real_escape_string($con, $cnewpass);
Page 62
include ("change_pass.php");
}
}
else {
$error = "<center><h4><font color='#FF0000'>Error!</h4></center></font>";
include ("change_pass.php");
}
?>
CONNECTION.PHP
<?php
$con = mysqli_connect("localhost","root","","polltest") or die ("error" . mysqli_error($con));
?>
FOTER.PHP
<br>
<br>
<br>
<br>
<center><b><i>VOTE FOR NEW LEADERSHIP </i></b></center>
Page 63
</body>
</html>
HEADER.PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-tra
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Online Voting System</title>
<script src="jscript/validation.js" type="text/javascript"></script>
</head>
<body bgcolor="#EBE9E9">
<marquee>Welcome To Online Voting System </marquee>
<center><font size='8' >
<a href="index.php">Home</a> | <a href="register.php">Register</a> | &n
<br>
<br>
Page 64
HEADER_VOTER.PHP
<body bgcolor="#EBE9E9">
Page 65
<marquee>Welcome To Online Voting System
</marquee>
<center><font size='6' >
<a href="voter.php">Home</a> | <a href="lan_view.php">Vote Results</a> |&nb
<a href="logout.php">Logout</a>
| <a href="change_pass.php">Change Password</a>
</font></center>
INDEX.PHP
<?php include "header.php";
session_start();
if (isset($_SESSION['SESS_NAME'])!="") {
header("Location: voter.php");
}
?>
<?php global $msg; echo $msg;?>
<p><center><legend><font color='#008000' size='18'>This system allows all registered users to vote for their favorite POLI
<p>In order to make a vote you have to register first and then login.</font></legend></center>
<p> </p>
<?php include "footer.php";?>
PARTY VIEW.PHP
<?php
if(!isset($_SESSION)) {
session_start();
}
include "auth.php";
Page 66
include "header_voter.php";
?>
<center><h3> Voting So Far </h3></center>
<?php
include "connection.php";
$member = mysqli_query($con, 'SELECT * FROM languages' );
if (mysqli_num_rows($member)== 0 ) {
echo '<font color="red">No results found</font>';
}
else {
echo '<center><table><tr bgcolor="#FF6600">
<td width="30px">ID</td>
<td width="100px">LANGAUAGE</td>
<td width="100px">ABOUT</td>
<td width="30px">VOTE</td>
</tr>';
while($mb=mysqli_fetch_object($member))
{
$id=$mb->party_id;
$name=$mb->fullname;
$about=$mb->about;
$vote=$mb->votecount;
echo '<tr bgcolor="#BBBEFF">';
echo '<td>'.$id.'</td>';
echo '<td>'.$name.'</td>';
echo '<td>'.$about.'</td>';
echo '<td>'.$vote.'</td>';
echo "</tr>";
}
echo'</table></center>';
}
?>
LOGIN.PHP
<?php include "header.php";
if(!isset($_SESSION)) {
session_start();
}
if (isset($_SESSION['SESS_NAME'])!="") {
header("Location: voter.php");
}
Page 67
?>
<br>
<center>
<legend> <h3>Login for Voting </h3></legend>
<br>
</center>
<?php global $nam; echo $nam; ?>
<?php global $error; echo $error; ?>
<br>
<center><font size="4" >
<form action="login_action.php" method="post" id="myform" >
Username :
<input type="text" name="username" value="" >
<br>
<br>
Password :
<input type="password" name="password" value="" >
<br>
<br>
<input type="submit" name="login" value="login" >
</form></font>
</center>
LOGIN ACTION.PHP
<?php
session_start();
include "connection.php";
if(isset($_POST['login'])) {
$username = $_POST["username"];
$password = $_POST["password"];
$username = addslashes($username);
$password = addslashes($password);
Page 68
$username = mysqli_real_escape_string($con,$username);
$password = mysqli_real_escape_string($con,$password);
if($member['rank']=='administrator'){
header("location: admin.php");
}
else if($member['rank']=='voter'){
header("location: voter.php");
}
}
else {
$error = "<center><h4><font color='#FF0000'>Incorrect Username or Password</h4></center></font>";
include "login.php";
}
}
else {
$error = "<center><h4><font color='#FF0000'>Invalid Username or Password</h4></center></font>";
include "login.php";
}
?>
LOGOUT.PHP
<?php
session_start();
if (!isset($_SESSION['userSession'])) {
header("Location: login.php");
} else if (isset($_SESSION['userSession'])!="") {
header("Location: index.php");
}
if("username"){
session_destroy();
unset($_SESSION['SESS_NAME']);
include'login.php';
}
Page 69
?>
PROFILE.PHP
<?php
if(!isset($_SESSION)) {
session_start();
}
include "auth.php";
include "header_voter.php";
include "connection.php";
?>
<h4> Welcome <?php echo $_SESSION['SESS_NAME']; ?> </h4>
<?php
$username = $_SESSION['SESS_NAME'];
$query = 'SELECT status FROM voters WHERE username="'.$_SESSION['SESS_NAME'].'" AND status = "VOTED"';
if ($result = mysqli_query($con,$query)) {
if (mysqli_num_rows($result) > 0) {
$sql = mysqli_query($con, 'SELECT voted from voters WHERE username="'.$_SESSION['SESS_NAME'].'"');
$row = mysqli_fetch_assoc($sql);
echo "You have voted for: " . " " . $row['voted'];
} else {
echo "You have not voted yet. Please submit your vote!";
}
}
?>
REGISTER ACTION.PHP
<?php
session_start();
$captcha = "" ;
include "connection.php";
if(isset($_POST['submit'])) {
/*if (isset($_POST['g-recaptcha-response'])){
$captcha=$_POST['g-recaptcha-response'];
}
if(!$captcha){
$error = "Please check captcha too";
include ('register.php');
exit();
}
$secretKey = "6LeD3hEUAAAAADNeeaGRfKmABjn1gnsXxrpdTa2J";
$ip = $_SERVER['REMOTE_ADDR'];
Page 70
$response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$cap
$responseKeys = json_decode($response,true);
if(intval($responseKeys["success"]) !== 1) {
$error = "You are spammer !";
}*/
$name = mysqli_real_escape_string($con, $_POST['firstname']);
$name2 = mysqli_real_escape_string($con,$_POST['lastname']);
$name3 = mysqli_real_escape_string($con,$_POST['username']);
$pass = mysqli_real_escape_string($con,$_POST['password']);
if($exist==1){
$nam="<center><h4><font color='#FF0000'>The username already exist, peak another.</h4></center></font>";
unset($username);
include('register.php');
exit();
}
$sql = mysqli_query($con, 'INSERT INTO voters(firstname,lastname,username)
VALUES("'.$_POST['firstname'].'","'.$_POST['lastname'].'","'.$_POST['username'].'")');
if (!$sql) {
die (mysqli_error($con));
}
$sql2 = mysqli_query($con, 'INSERT INTO loginusers(username,password)
VALUES("'.$_POST['username'].'","'.md5($_POST['password']).'")');
if (!$sql2) {
die (mysqli_error($con));
}
else {
echo "Successfully Registered! <a href= 'login.php'>Clich here to Login </a>";
}
}
else {
$error="<center><h4><font color='#FF0000'>Registration Failed Due To Error !</h4></center></font>";
include"register.php";
}
?>
Page 71
REGISTER.PHP
<script src='https://www.google.com/recaptcha/api.js'></script>
<?php include "header.php";
if(!isset($_SESSION)) {
session_start();
}
if (isset($_SESSION['SESS_NAME'])!="") {
header("Location: voter.php");
}
?>
<br>
<br>
<center>
<legend> <h3> Register </h3></legend> </center>
<?php global $nam; echo $nam; ?>
<?php global $error; echo $error; ?>
<center><font size="4" >
<form action= "reg_action.php" method= "post" id="myform" >
Firstname:
<input type="text" name="firstname" value="" />
<br>
<br>
Lastname:
<input type="text" name="lastname" value="" />
<br>
<br>
Username:
<input type="text" name="username" value="" />
<br>
<br>
Password:
<input type="password" name="password" value="" />
<br>
<br>
<div class="g-recaptcha" data-sitekey="6LeD3hEUAAAAAKne6ua3iVmspK3AdilgB6dcjST0"></div>
<br>
<br>
<input type="submit" name="submit" value="Next" />
Page 72
</form>
</font>
</center>
<script type= "text/javascript" >
var frmvalidator = new Validator("myform");
frmvalidator.addValidation("firstname","req","Please enter student firstname");
frmvalidator.addValidation("firstname","maxlen=50");
frmvalidator.addValidation("lastname","req","Please enter student lastname");
frmvalidator.addValidation("lastname","maxlen=50");
frmvalidator.addValidation("username","req","Please enter student username");
frmvalidator.addValidation("username","maxlen=50");
frmvalidator.addValidation("password","req","Please enter student password");
frmvalidator.addValidation("password","minlen=6","Password must not be less than 6 characters.");
</script>
<?php include "footer.php" ;?>
SUBMIT VOTE.PHP
<?php
include "connection.php";
session_start();
if(empty($_POST['lan'])){
$error="<center><h4><font color='#FF0000'>Please select a language to vote!</h4></center></font>";
include"voter.php";
exit();
}
$lan = $_POST['lan'];
$sess = $_SESSION['SESS_NAME'] ;
$lan = addslashes($_POST['lan']);
$lan = mysqli_real_escape_string($con, $lan);
$sql = mysqli_query($con, 'SELECT * FROM voters WHERE username="'.$_SESSION['SESS_NAME'].'" AND status="V
if(mysqli_num_rows($sql) > 0 ) {
$msg="<center><h4><font color='#FF0000'>You have already been voted, No need to vote again</h4></center></font>"
include 'voter.php';
exit();
}
else{
$sql1 =mysqli_query($con, 'UPDATE languages SET votecount = votecount + 1 WHERE fullname = "'.$_POST['lan'].'"');
$sql2 =mysqli_query($con, 'UPDATE voters SET status="VOTED" WHERE username="'.$_SESSION['SESS_NAME'].'"')
$sql3 = mysqli_query($con, 'UPDATE voters SET voted= "'.$_POST['lan'].'" WHERE username="'.$_SESSION['SESS_NA
if(!$sql1 && !$sql2){
die("Error on mysql query".mysqli_error());
}
else{
$msg="<center><h4><font color='#FF0000'>Congratulation, you have made your vote.</h4></center></font>";
Page 73
include 'voter.php';
exit();
}
}
?>
VOTE.PHP
<?php
if(!isset($_SESSION)) {
session_start();
}
include "auth.php";
include "header_voter.php";
?>
<h4> Welcome <?php echo $_SESSION['SESS_NAME']; ?> </h4>
<h3>Make a Vote </h3>
<form action="submit_vote.php" name="vote" method="post" id="myform" >
<center><font size='6'> What is your favorite political party? <BR>
<input type="radio" name="lan" value="BJP"> BJP<BR>
<input type="radio" name="lan" value="CONGRESS">CONGRESS<BR>
<input type="radio" name="lan" value="AAP"> AAP<BR>
<input type="radio" name="lan" value="NOTA"> NOTA<BR>
<input type="radio" name="lan" value="NIRDLIY"> NIRDLIY<BR>
</font></center><br>
<?php global $msg; echo $msg; ?>
<?php global $error; echo $error; ?>
<center><input type="submit" value="Submit Vote" name="submit" style="height:30px; width:100px" /></center>
</form>
Page 74
CONCLUSION
Electors abroad are clearly a focus group that is of particular interest for those cou
introduction of e-voting in a general manner. At the same time, they are a target g
voting for practical reasons. Other countries see a need to introduce e-voting for t
same urgency for introducing e-voting for the internal electors. However, there is
introduction of remote e-voting, not even in the countries where the first steps tow
Page 75
REFRENCES
BOOK: -
1. Head first Html and Css Book by Elisabeth Robson and Eric Freeman
2. HTML & CSS: Design and Build Web Sites Book by Jon Duckett.
WEB REFERNCES:-
1. https://www.w3schools.com/php/
2. https://www.w3schools.com/html
3. https://www.javatpoint.com/css-tutorial
4. https://javascript.info/
5. https://www.mysqltutorial.org/
Page 76
Page 77
Page 78
Page 79
Page 80
Page 81
Page 82
Page 83
Page 84
Page 85
Page 86
Page 87
Page 88
Page 89
Page 90
Page 91
Page 92
Page 93
Page 94
Page 95
Page 96