Online Voting System - Report

Download as pdf or txt
Download as pdf or txt
You are on page 1of 59

ONLINE VOTING SYSTEM

A PROJECT REPORT

Submitted by
CHANDRU G (710020104006)
SARMITHA RAJSHRI T (710020104027)
KAVIN R B (710020104307)
SRINIVASAN M (710020104317)

in partial fulfilment for the award of the degree

of

BACHELOR OF ENGINEERING

in

COMPUTER SCIENCE AND ENGINEERING

ANNA UNIVERSITY REGIONAL CAMPUS


COIMBATORE – 641046

ANNA UNIVERSITY: CHENNAI 600 025

MAY 2024
ANNA UNIVERSITY: CHENNAI 600 025

BONAFIDE CERTIFICATE

Certified that this project report “ONLINE VOTING SYSTEM” is the bonafide
work of “CHANDRU G (710020104006), SARMITHA RAJSHRI T (710020104027),
KAVIN R B (710020104307), SRINIVASAN M (710020104317)” who carried out the
project work under my supervision.

SIGNATURE SIGNATURE
Dr. S.V MANISEKARAN Mr. D. PRABHU
HEAD OF THE DEPARTMENT ASSISTANT PROFESSOR
Department of Computer Science Department of Computer Science
and Engineering, and Engineering,
Anna University Regional Campus Anna University Regional Campus
Coimbatore. Coimbatore.
ACKNOWLEDGEMENT

First and foremost, we thank GOD almighty who paved the way for our walk which
lifted us to pluck the fruits of success and who is the torch for all our endeavors and
engagements.
With profound sense of gratitude, we sincerely thank Dr. R. VELRAJ, Vice
Chancellor, Anna University, Chennai for providing necessary facilities in the university to
complete our project work successful.
We are deeply grateful to express our heartfelt appreciation to
Dr. G. RAVIKUMAR, our esteemed Registrar.
We express our deepest appreciation to Dr. M. SARAVANAKUMAR, the esteemed
Dean of Anna University Regional Campus Coimbatore, for his unwavering support and
encouragement throughout the duration of our project.
We would like to convey our sincere gratitude to Dr. S.V. MANISEKARAN, Head
of the Department of Computer Science and Engineering, for his invaluable support in
completing this project.
We would like to convey our sincere gratitude to our project coordinator Dr.
P. MARIKKANNU, Department of Computer Science and Engineering, for his invaluable
support and guidance in completing this project.
We express our hearty thanks to our project guide Mr. D. PRABHU, Department of
Computer Science and Engineering for his encouragement, involvement, caretaking and
valuable guidance with keen interest towards the completion and shaping of this project and
report.
We convey our thanks to all Teaching and Non-Teaching Staff Members of the
college who rendered their co-operation by all means for completing this project. Also, we
thank our parents and friends who were very supportive for partial completion of my
project.
ABSTRACT

Initially, voting in India relied heavily on manual processes, leading to challenges

such as long queues, logistical issues, and sometimes, electoral fraud. However, with

advancements in technology, electronic voting machines (EVMs) in the 1990s, was

introduced. Despite its efficiency, EVMs faced criticisms regarding security and

transparency. To address these concerns, this project work explores the concept of online

voting system with advanced encryption techniques, authentication mechanisms, and secure

communication protocols to ensure the integrity and confidentiality of votes. The system

offers a user-friendly interface accessible via web browsers, facilitating voter registration,

ballot access, and vote casting. Real-time result tabulation and reporting functionalities

promote transparency and accountability in electoral outcomes. The proposed system

increases voter turnout, enhance accessibility for people with disabilities, and streamline

electoral administration. In summary, the proposed online voting system represents a

significant milestone in the evolution of voting systems in India. By leveraging technology

to address longstanding challenges and enhance the democratic experience, this system

holds the promise of fostering greater trust, participation, and accountability in the electoral

process, thereby advancing the principles of democracy in the digital age.

iv
TABLE OF CONTENTS

CHAPTER PAGE
TITLE
NO. NO.
ABSTRACT iv
LIST OF FIGURES viii
LIST OF ABBREVIATION ix
1 INTRODUCTION 1
1.1 INTRODUCTION 1
1.1.1 Background and context 1
1.1.2 Significance of online voting 2
1.2 OBJECTIVES OF THE PROJECT 3

2 LITERATURE SURVEY 5
2.1 RELEVANCE OF RESEARCH PAPERS AND STUDIES 5

3 SYSTEM ANALYSIS 8
3.1 PROBLEM STATEMENT 8
3.2 OVERVIEW OF EXISTING VOTING SYSTEM 8
3.3 EXISTING SYSTEM 9
3.4 PROPOSED SYSTEM 10
3.4.1 Scope of the project 10
3.4.2 Proposed System 10
3.4.3 Advantages 11

4 SYSTEM DESIGN 13
4.1 OVERVIEW 13
4.2 USECASE DIAGRAM 13
4.3 ENTITY RELATIONSHIP DIAGRAM 14
4.4 FLOW DIAGRAM 15

v
5 PROJECT DESCRIPTION 16
5.1 SYSTEM ARCHITECTURE 16
5.2 TECHNOLOGIES USED 20
5.2.1 Html 20
5.2.2 Css 20
5.2.3 Admin lte bootstrap 21
5.2.4 Php 21
5.2.5 Javascript 22
5.2.6 Python (OpenCV) 22
5.2.7 Mysql 23
5.3 WORKING PRINCIPLE 23
5.3.1 User interface 24
5.3.1.1 Registration module 24
5.3.1.2 Login module 24
5.3.1.3 Voting interface 24
5.3.1.4 Verification mechanisms 24
5.3.2 Admin panel 25
5.3.2.1 Voter management 25
5.3.2.2 Election management 25
5.3.2.3 Result announcement 25
5.3.2.4 User management 25
5.3.2.5 Security measures 26
5.3.3 Integration with external APIs 26
5.3.3.1 SMS notification API 26
5.3.3.2 Face recognition API 26
5.3.4 System security 26
5.3.4.1 Encryption techniques 27
5.3.4.2 User authentication 27

vi
5.3.4.3 Access control 27
5.3.5 Scalability and future enhancement 27
5.4 METHODOLOGIES USED 27
5.4.1 AES (advanced encryption standard) 28
5.5 RESULTS 29

6 CONCLUSION 34
6.1 CONCLUSION 34
6.2 FUTURE ENHANCEMENT 34

REFERENCES 35

APPENDIX 1.1 37
IMPLEMENTATION 37

vi
LIST OF FIGURES

FIGURE
FIGURE NAME PAGE NO.
NO.
4.1 USE CASE DIAGRAM 17
4.2 ENTITY RELATIONSHIP DIAGRAM 18
4.3 FLOW DIAGRAM 19
5.1.a ARCHITECTURE DIAGRAM(ADMIN) 20
5.1.b ARCHITECTURE DIAGRAM(USER) 21
5.5.1 BEFORE CASTING VOTE -DURING ELECTION 30
5.5.2 AFTER CASTING VOTE 31
5.5.3 ADMIN DASHBOARD
5.5.4 RESULTS AFTER ELECTION 39

viii
LIST OF ABBREVIATION

HTML – Hyper-Text Mark-up Language

CSS – Cascading Style Sheet

PHP – Hypertext preprocessor

MYSQL – My Standard Query Language

AES – Advanced Encryption Standard

SMS –Short Message Service

API – Application Programming Interface

OpenCV – Opensource Computer Vision

OTP – One Time Password

UI – User Interface

SHA-256– Secure Hash Algorithm 256-bit

MFA – Multi Factor Authentication

ix
CHAPTER 1

INTRODUCTION

1.1 INTRODUCTION

Online voting, also known as e-voting, is a digital system that allows voters to cast
their ballots electronically over the internet. It offers a convenient and efficient alternative
to electronic voting system. Online voting systems typically require voters to authenticate
their identity securely before they can access the ballot. This authentication process helps
ensure the integrity and security of the voting process by preventing fraudulent activities.
One of the primary advantages of online voting is its accessibility, as it allows voters to
participate from anywhere with an internet connection, eliminating the need for physical
presence at polling stations. Additionally, online voting can potentially increase voter
turnout by providing a more convenient option for busy individuals or those unable to
visit polling stations. However, concerns regarding the security, privacy, and reliability of
online voting systems persist, leading to debates and ongoing efforts to develop robust
solutions that address these issues effectively. Despite these challenges, the adoption of
online voting continues to grow as technology advances and societies seek to modernize
democratic processes.

1.1.1 Background and Context

The concept of online voting emerged as a response to the increasingly digital


nature of modern society. As technology permeates every aspect of our lives, the
traditional EVM voting system faced criticism for being outdated, inefficient, and less
accessible to certain demographics. The potential benefits of online voting, such as

1
increased voter participation, cost-effectiveness, and faster result tabulation, have sparked
interest and investment in developing digital voting solutions worldwide.

However, the transition to online voting has been met with challenges and
controversies. Concerns about cybersecurity vulnerabilities, the potential for hacking or
manipulation, and the difficulty of ensuring voter privacy and anonymity have raised
significant doubts about the feasibility and safety of online voting systems. Despite these
challenges, several countries and organizations have experimented with pilot programs
and trials to explore the potential of online voting, while others remain cautious and
continue to rely on traditional voting methods.

The debate over online voting reflects broader discussions about the intersection of
technology and democracy, highlighting the need to balance innovation with security and
trust in electoral processes. As technology evolves and society becomes increasingly
interconnected, finding viable solutions to the complexities of online voting remains a
pressing concern for policymakers, technologists, and citizens alike.

1.1.2 Significance of Online Voting

The significance of implementing online voting transcends mere convenience; it


represents a pivotal advancement in democratic processes worldwide. By leveraging
technology to facilitate voting, online voting projects aim to democratize access to the
electoral process, breaking down barriers such as physical location, mobility constraints,
and time limitations. This inclusivity fosters greater civic engagement and participation,
empowering marginalized communities and enhancing the representativeness of elected
bodies.

Moreover, online voting has the potential to revolutionize the electoral landscape
by streamlining the voting process, reducing administrative burdens, and minimizing the
environmental impact associated with traditional EVM-based voting. The efficiency gains

2
from online voting can lead to cost savings for governments and electoral bodies, enabling
them to allocate resources more effectively towards other essential services and
initiatives.

Furthermore, the adoption of online voting sets a precedent for embracing


technology as a tool for modernizing democratic institutions, reflecting society's evolving
needs and expectations in the digital age. As countries worldwide grapple with the
complexities of electoral reform, online voting projects serve as catalysts for innovation,
collaboration, and continuous improvement in democratic governance. Ultimately, the
successful implementation of online voting projects stands to redefine the democratic
landscape, promoting accessibility, efficiency, and integrity in electoral processes for
generations to come.

1.2 OBJECTIVES OF THE PROJECT

The primary objective of the online voting project is to modernize and enhance
democratic processes by implementing a secure, accessible, and efficient digital voting
platform. Key objectives include:

i. Increasing voter participation: By providing an online voting option, the project


aims to remove barriers to participation, enabling more citizens to exercise their
democratic right to vote.
ii. Enhancing accessibility: The project seeks to make voting more accessible to
individuals with mobility issues, those living in remote areas, and citizens residing
abroad, ensuring inclusivity in the electoral process.
iii. Improving efficiency: Transitioning from traditional EVM-based voting to an
online platform streamlines the voting process, reducing administrative burdens,
and expediting result tabulation.
iv. Ensuring security and integrity: Implementing robust security measures such as
encryption, authentication protocols, and audit trails safeguards against fraud,
3
manipulation, and unauthorized access, bolstering confidence in the integrity of the
electoral system.
v. Facilitating transparency and accountability: The project aims to enhance
transparency by providing mechanisms for voters to verify their ballots and for
authorities to audit the voting process, fostering trust in electoral outcomes.
vi. Promoting innovation in democratic governance: By embracing technology and
exploring new voting methodologies, the project serves as a catalyst for innovation
in democratic governance, paving the way for future advancements in electoral
systems.

4
CHAPTER 2

LITERATURE SURVEY

2.1 RELEVANCE OF RESEARCH PAPERS AND STUDIES

Relevant research papers and studies were reviewed to gather insights into effective
design principles, security measures, and user experience considerations in online voting
systems.

[1] “A Secure Approach for Web-Based Internet Voting System using Multiple
Encryption”, S.M. Jambhulkar, J.B. Chakole, and P.R. Pardhi. This approach suggests a
practical application of the existing cryptographic schemes and digital signature that
ensures integrity of the vote and authentication of voter at the two levels.

[2] “Efficient Voting System with (2,2) Secret Sharing Based Authentication”, A.
Walake and P. Chavan. Providing security to any data or information is an important issue
and sensitive. It provides secured authentication through the Shamir’s secret sharing
scheme.

[3] “Security Analysis of the Estonian Internet Voting System”, D. Springall et al.
The paper analyzes the security of Estonia's Internet voting system. It finds serious flaws
that could compromise election integrity. Experimental attacks demonstrate potential
vulnerabilities. The findings suggest challenges for Internet voting adoption worldwide.

[4] “Ensuring Voters and Candidates' Confidentiality in E-voting Systems”, H. Pan,


E. Hou, and N. Ansari. The voting system enables voters to access candidate details for
informed decisions. Successful authentication allows for one vote per candidate per
election, ensuring security and fairness.

5
[5] “Digital Voting”, V. Patel, J. Jadeja, K. Patil, and K. Rai. The Election
Commission (EC) oversees vote counting and verifies voter IDs, while a separate Vote
Counting Committee (VCC) tallies votes anonymously. The EC discloses the final tally
without revealing individual votes, maintaining confidentiality.

[6] “Enhancing Security in Internet Voting Systems using Homomorphic


Encryption”, R. Gupta, S. Sharma, and A. Singh. This paper proposes the use of
homomorphic encryption techniques to enhance the security of internet voting systems. It
explores how homomorphic encryption can enable secure vote casting and vote counting
while preserving voter privacy.

[7] “A Novel Authentication Mechanism for Remote E-Voting Systems”, M. Khan,


N. Ahmed, and S. Malik. This paper presents a novel authentication mechanism
specifically designed for remote electronic voting systems. It introduces a multi-factor
authentication approach that combines biometric data with cryptographic techniques to
ensure the integrity and authenticity of voters.

[8] “Privacy-Preserving E-Voting Protocols using Zero-Knowledge Proofs”, A.


Gupta, S. Kumar, and R. Verma. This paper proposes privacy-preserving e-voting
protocols based on zero-knowledge proofs. By leveraging cryptographic techniques such
as zk-SNARKs (Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge),
the protocols ensure that votes remain confidential while still allowing for verifiability
and integrity.

[9] “Secure and Verifiable E-Voting Systems using Blockchain Technology”, T.


Sharma, K. Gupta, and N. Kumar. This paper explores the use of blockchain technology
to build secure and verifiable e-voting systems. It discusses how blockchain's distributed
ledger capabilities can enhance transparency, immutability, and auditability in electronic
voting processes while maintaining voter anonymity.

6
[10] “Fault-Tolerant E-Voting Systems with Threshold Cryptography”, S. Agarwal,
R. Kapoor, and M. Singh. This paper presents fault-tolerant e-voting systems employing
threshold cryptography techniques. By distributing cryptographic keys among multiple
authorities, the system ensures that no single point of failure can compromise the integrity
or confidentiality of the voting process

[11] “Anonymous and Auditable E-Voting Systems using Mix Networks”, P.


Gupta, R. Sharma, and K. Singh. This paper introduces an e-voting system that combines
anonymity with auditability through the use of mix networks. It describes how mix
networks can shuffle and encrypt votes in such a way that individual voter privacy is
preserved while still allowing for the verification of election

7
CHAPTER 3

SYSTEM ANALYSIS

3.1 PROBLEM STATEMENT

The problem statement for the online voting system project revolves around the
inefficiencies and vulnerabilities of traditional paper-based voting methods. Key issues
include limited accessibility for certain demographics, security concerns regarding fraud
and manipulation, administrative burdens associated with manual processes, and low
voter turnout due to inconvenience. Additionally, the lack of transparency in verifying
votes and ensuring electoral integrity poses challenges to the legitimacy of election
outcomes. To address these issues, the project aims to develop a secure, user-friendly
online voting platform, enabling eligible voters to cast their ballots electronically from
anywhere with internet access. This system will streamline administrative tasks, enhance
accessibility for all voters, and implement robust security measures to safeguard the
integrity of the electoral process.

3.2 OVERVIEW OF EXISTING VOTING SYSTEM

The existing voting system typically relies on traditional paper-based methods


where voters physically visit designated polling stations to cast their votes. Eligible voters
register in person, receive paper ballots, and manually mark their choices. Election
officials then manually count the paper ballots to determine the election results. Security
measures such as seals and observers are employed to prevent tampering, and verification
processes ensure the integrity of the voting process. However, this system is often
associated with challenges such as limited accessibility, administrative burdens, and
susceptibility to fraud and errors.

8
3.3 EXISTING SYSTEM

The existing system for the electronic voting machine (EVM) project typically
relies on modern electronic methods. However, it's essential to acknowledge some
drawbacks:

1. Registration Process: While electronic registration streamlines the process, it may


exclude citizens without access to technology or those unfamiliar with online
registration platforms.
2. Electronic Voting: EVMs offer convenience, but concerns about hacking or
software manipulation may undermine confidence in the system's security and
accuracy.
3. Vote Tabulation: Although electronic tabulation speeds up results, the reliance on
complex software introduces the possibility of errors or vulnerabilities that could
compromise the integrity of the election outcome.
4. Security Protocols: While robust security measures are in place, the potential for
cyberattacks or insider threats remains a significant concern, necessitating ongoing
vigilance and updates to safeguard against emerging risks.
5. Accessibility Solutions: While EVMs provide accessibility features, there may still
be challenges in ensuring equitable access for all voters, especially those in remote
areas with limited infrastructure or those with specific disabilities that may not be
fully accommodated by existing technology.
6. Verification and Transparency Enhancements: Digital records enhance
transparency, but they also raise concerns about the verifiability of electronic votes
and the potential for manipulation or technical glitches that could undermine trust
in the electoral process.

9
3.4 PROPOSED SYSTEM

3.4.1 Scope of the Project

The project scope involves creating an online voting platform accessible to eligible
voters. It includes developing a secure authentication system, a user-friendly interface,
and backend infrastructure for data management. The scope extends to conducting
thorough testing, ensuring compliance with regulatory requirements, and providing
support for voter registration and result tabulation.

3.4.2 Proposed System

The proposed system for the online voting project is an electronic voting platform
developed using PHP. Key features include:

1. Online Registration: Eligible voters can register online by providing personal


information and verifying their identity electronically.
2. Secure Authentication: The system employs robust authentication mechanisms,
such as username-password combinations or multi-factor authentication, to ensure
the security and integrity of voter accounts.
3. Electronic Balloting: Voters can access their ballots online, where they can view
candidate information and cast their votes electronically.
4. Encryption and Security Measures: The system utilizes encryption techniques and
other security measures to protect voter data and prevent unauthorized access or
tampering.
5. Real-time Result Tabulation: Votes are tabulated automatically in real-time,
providing instant access to election results once voting concludes.

10
6. Accessibility Enhancements: The online voting platform is designed to be
accessible to individuals with disabilities, allowing them to participate in the
electoral process without barriers.
7. Transparency and Auditability: The system includes features for verifying votes
and ensuring transparency in the voting process, such as audit logs and
mechanisms for verifying the integrity of the voting system.

3.4.3 Advantages

The proposed online voting system offers several advantages over traditional paper-based
voting methods:

1. Accessibility: The online platform enables voters to participate in the electoral


process from anywhere with internet access, removing barriers related to physical
location and mobility constraints.
2. Convenience: Voters can access their ballots and cast their votes electronically at
their convenience, reducing the need to visit physical polling stations during
limited voting hours.
3. Efficiency: The electronic voting system streamlines administrative processes such
as voter registration, ballot distribution, and result tabulation, saving time and
resources for electoral authorities.
4. Real-time Results: Votes are tabulated automatically in real-time, allowing for
instant access to election results once voting concludes, enhancing transparency
and public trust in the electoral process.
5. Security: The system employs robust encryption techniques and authentication
mechanisms to safeguard voter data and prevent unauthorized access or tampering,
ensuring the integrity and confidentiality of the voting process.

11
6. Accuracy: Electronic voting minimizes the risk of human error associated with
manual counting and recording of paper ballots, leading to more accurate and
reliable election outcomes.
7. Environmental Impact: By reducing the reliance on paper ballots and
administrative paperwork, the online voting system helps minimize the
environmental footprint of the electoral process.

12
CHAPTER 4

SYSTEM DESIGN

4.1 OVERVIEW

The system design of the online voting system plays a critical role in ensuring its
functionality, usability, and scalability. This chapter presents a detailed overview of the
system design.

4.2 USE CASE DIAGRAM

A use case diagram represents the interactions between actors (users or external
systems) and the system. It provides a high-level view of the system's functionality and
the actors involved. The use case diagram for the online voting system may include the
following use cases:

Figure 4.2 Use Case Diagram


13
4.3 ENTITY RELATIONSHIP DIAGRAM

An Entity-Relationship (ER) diagram serves as a foundational blueprint for


database design, capturing the interconnections between various entities within a system.
In the context of an online voting system, the ER diagram delineates the structural
framework, defining the entities, their attributes, and the relationships that bind them
together

Figure 4.3 Entity Relationship Diagram

14
4.4 FLOW DIAGRAM:

A flow diagram for an online voting system visually represents the process
involved in conducting elections through a digital platform. It illustrates the sequence of
actions from user registration to the declaration of final results.

Users access the voting interface where they can make their selections from a list of
candidates or options. After submitting their votes, the system tallies all the votes to
determine the outcome of the election. Final results are then declared based on the tallied
votes. Throughout the process, robust security measures are in place to safeguard the
integrity and confidentiality of the voting process.

The flow diagram serves as a comprehensive visual representation, aiding


stakeholders in understanding the flow of information and actions within the online voting
system.

Figure 4.4 Flow Diagram

15
CHAPTER 5

PROJECT DESCRIPTION

5.1 SYSTEM ARCHITECTURE

The online voting system architecture comprises a presentation layer for user
interaction, an application layer for business logic, and a database layer for data storage.
Security measures are implemented across layers to protect against unauthorized access
and data breaches. Integration components facilitate communication with external
services such as authentication providers. The infrastructure layer supports the system
with scalable hardware and software resources, ensuring reliability and performance. This
architecture enables secure, accessible, and efficient online voting processes.

Figure 5.1 a) Architecture diagram (Admin module)

16
Registration

The online voting system starts with the process of registration. Here public are the
voters and their credentials are collected by means of the registration. If the credentials are
true and valid the they will be allocated with the user login credentials. Using those user
credentials the valid user are able to cast their vote and check the results of the elections.

Admin

The admin is controlling sector for the registration of the both voters and the
candidates. They also validate the details of the voters and the candidates. They also do a
vital role in starting and ending of the elections. Finally publishes the result of the
conducted elections held.

Figure 5.1 b) Architecture diagram (User module)

17
Election Process

An online voting system typically follows a series of steps to ensure a secure and
reliable voting process. Here's a basic outline of the voting process in an online voting
system

Voter Registration

Voters need to register for the online voting system. This often involves providing
identification information to verify eligibility to vote. The system may require additional
authentication methods to ensure the security of the voter's identity, such as two-factor
authentication or biometric verification.

Voter Authentication

Once registered, voters need to authenticate themselves when accessing the online
voting system. This can be done using login credentials, biometric data, or other secure
authentication methods. Authentication measures are crucial to prevent unauthorized
access and ensure the integrity of the voting process.

Ballot Issuance

After authentication, the system issues a digital ballot to the voter. The ballot
contains the list of candidates or options for the election or referendum. The design of the
ballot should be clear and intuitive to ensure voters can easily understand and make their
selections.

Voting

Voters cast their votes by selecting their preferred candidates or options on the
digital ballot. The online system should provide mechanisms for voters to review and
verify their selections before submitting their votes to prevent errors.

18
Vote Submission

Once the voter has made their selections, they submit their ballot through the online
system. The system should confirm the successful submission of the vote and provide a
receipt or confirmation to the voter for their records.

Vote Counting

The online system securely collects and tallies the votes after the voting period
ends. Various security measures, such as encryption and digital signatures, are employed
to ensure the integrity and confidentiality of the voting data during transmission and
counting.

Results Verification

Election officials or independent auditors verify the integrity of the voting process
and the accuracy of the results. This may involve auditing the system logs, conducting
random audits of ballots, or employing other verification techniques to ensure the fairness
and accuracy of the election.

Declaration of Results

Once the results have been verified, the online voting system announces the
outcome of the election or referendum. The results are made available to the public and
relevant stakeholders through secure channels to maintain transparency and trust in the
electoral process.

Throughout the entire process, the online voting system must prioritize security, privacy,
and reliability to ensure the integrity of the democratic process and uphold the trust of
voters in the system. Additionally, robust legal and regulatory frameworks are essential to
govern the use of online voting systems and protect against potential threats or
vulnerabilities.

19
5.2 TECHNOLOGIES USED

5.2.1 HTML

HTML (Hypertext Markup Language) is the standard language for creating web
pages. It consists of a series of elements that structure content on a webpage, such as
headings, paragraphs, links, and images. These elements are enclosed in tags, which
define their purpose and formatting.

In the context of an online voting project, HTML is used to create the layout and
structure of the voting interface. This includes designing the ballot form, displaying
candidate information, and incorporating navigation elements for users to interact with the
voting system. HTML provides the foundation for integrating other technologies, such as
CSS (Cascading Style Sheets) for styling and JavaScript for interactivity, enhancing the
functionality and aesthetics of the voting webpage. By adhering to HTML standards,
developers ensure compatibility across different web browsers and devices, enabling a
seamless voting experience for users regardless of their platform.

5.2.2 CSS

Cascading Style Sheets (CSS) is a stylesheet language used to control the


presentation and layout of webpages. It enables developers to style HTML elements,
defining aspects such as colors, fonts, spacing, and positioning. In the context of an online
voting project, CSS can be utilized to create a visually appealing and user-friendly
interface for the voting platform. Through CSS, designers can customize the appearance
of buttons, forms, headers, and other interface elements to align with the project's
branding and usability requirements. CSS also facilitates responsive design, ensuring that
the webpage adapts seamlessly to different screen sizes and devices. Additionally, CSS
allows for the creation of animations and transitions, enhancing the interactive elements of
the voting platform. By separating style from content, CSS promotes code modularity,

20
maintainability, and scalability, facilitating easier updates and modifications to the
webpage's appearance over time.

5.2.3 AdminLTE bootstrap

AdminLTE is a free open-source admin dashboard template built on top of


Bootstrap, a popular front-end framework. It provides a clean and responsive design with
various UI components, plugins, and pre-designed layouts tailored for admin panels,
dashboards, and web applications.

For the online voting project, AdminLTE can be used to create an intuitive and
visually appealing admin interface for managing user accounts, monitoring voting
activity, and accessing administrative features.

By integrating AdminLTE with backend technologies such as PHP, Node.js, or


Python, developers can build a robust web application that facilitates voter registration,
ballot creation, and result tracking.

5.2.4 PHP

PHP, Hypertext Preprocessor, is a popular server-side scripting language primarily


used for web development. In online voting projects, PHP plays a crucial role in creating
dynamic web pages and handling server-side logic, such as user authentication, ballot
processing, and data storage. It integrates seamlessly with databases like MySQL to
manage voter registration details, ballot choices, and election results securely.
Additionally, PHP enables the creation of interactive features, such as real-time updates
on voter turnout or ballot counting progress. Its versatility and wide range of libraries and
frameworks make PHP an ideal choice for developing scalable and secure online voting
systems. Furthermore, PHP's open-source nature fosters collaboration and community
support, ensuring continuous improvement and adaptation to evolving technological
requirements in online voting projects.
21
5.2.5 JavaScript

JavaScript is a versatile programming language primarily used for creating


interactive and dynamic web content. In the context of an online voting project, JavaScript
is essential for developing the user interface elements of the voting platform, such as
buttons, forms, and animations. It enables real-time validation of user inputs, ensuring
data accuracy and integrity during the voting process. JavaScript also facilitates client-
side data manipulation and processing, enhancing the responsiveness and interactivity of
the voting application.

5.2.6 Python (OpenCV)

Facial recognition in Python using OpenCV involves leveraging computer vision


algorithms to detect and recognize faces within images or video streams. OpenCV
provides a comprehensive library of functions and tools for face detection, feature
extraction, and classification, making it a popular choice for facial recognition projects.

In this online voting project, facial recognition with OpenCV can be utilized to
enhance security and authentication measures. By integrating facial recognition into the
online voting platform, voters can verify their identity securely and conveniently using
their webcam or uploaded images. This helps prevent fraudulent activities such as
impersonation or multiple voting attempts.

The process typically involves capturing a voter's facial image during registration
or login, preprocessing the image to extract facial features, and then comparing these
features with a database of known identities. If a match is found, the voter is granted
access to the voting system, ensuring that only eligible individuals can participate.

Facial recognition with OpenCV also enables real-time monitoring and verification
during the voting process, helping to prevent unauthorized access or tampering with the
system.
22
5.2.7 MySQL

MySQL is an open-source relational database management system widely used for


storing, managing, and retrieving data in various applications, including online voting
systems. In this project, MySQL serves as the backend database where critical
information such as voter registration details, ballot choices, and election results are
stored securely. Through structured query language (SQL), developers can interact with
MySQL databases to perform operations such as inserting, updating, querying, and
deleting data. MySQL's scalability, reliability, and performance make it suitable for
handling the large volumes of data generated during elections. Additionally, MySQL's
support for transactions ensures data integrity and consistency, critical aspects of
maintaining the trustworthiness of the voting process. Integrating MySQL with the online
voting system enables efficient data management, real-time reporting, and analysis,
facilitating smooth and transparent electoral operations.

5.3 WORKING PRINCIPLE

The working principle of an online voting system involves creating a secure digital
platform for voters to cast their ballots remotely. Voters authenticate their identities
through robust verification methods such as biometrics or unique login credentials. The
system presents ballot options in a user-friendly interface, ensuring accessibility for all
eligible voters. Votes are encrypted and transmitted securely to a centralized server or
distributed ledger for tabulation.

5.3.1 USER INTERFACE

The user interface (UI) serves as the primary interaction point between voters and
the online voting system. It encompasses various elements designed to streamline the

23
voting process while ensuring user convenience and accessibility. The UI typically
consists of several modules, including:

5.3.1.1 Registration Module

The registration module enables users to create accounts by providing essential


personal details such as name, address, and contact information. Upon successful
registration, users receive credentials to access the voting platform.

5.3.1.2 Login Module

The login module allows registered users to access their accounts securely. Users
authenticate themselves using their credentials, typically a voter’s key and password
combination with captcha provided, to gain entry into the voting system.

5.3.1.3 Voting Interface

The voting interface presents users with a list of candidates and their respective
positions. Users can select their preferred candidates and submit their votes electronically.
The interface should be intuitive, user-friendly, and accessible across various devices to
accommodate a diverse user base.

5.3.1.4 Verification Mechanisms

To ensure the integrity of the voting process, robust verification mechanisms are
implemented. This may include multi-factor authentication methods such as SMS-based
OTPs or biometric authentication (e.g., facial recognition) to verify the identity of voters
before casting their votes.

5.3.2 ADMIN PANEL

The admin panel serves as the centralized control hub for managing various aspects
of the online voting system. It empowers administrators with the tools and functionalities

24
needed to oversee elections, manage users, and maintain system integrity. Key features of
the admin panel include:

5.3.2.1 Voter Management

Admins can manage voter registrations, verify voter identities, and ensure that only
eligible voters participate in elections. This involves reviewing registration requests,
approving/rejecting registrations, and updating voter information as needed.

5.3.2.2 Election Management

Admins have the authority to initiate, monitor, and conclude elections within the
system. This includes setting up election parameters (e.g., voting duration, candidate
eligibility), monitoring voting activity in real-time, and officially declaring election results
once voting concludes.

5.3.2.3 Result Announcement

Upon the conclusion of an election, admins are responsible for announcing the
official results to the public. This may involve generating comprehensive reports detailing
vote tallies, candidate rankings, and voter turnout statistics to ensure transparency and
accountability.

5.3.2.4 User Management

Admins can manage user accounts, roles, and permissions within the system. This
includes creating new admin accounts, assigning roles (e.g., super-admin, election
manager), and revoking access for inactive or unauthorized users.

5.3.2.5 Security Measures

The admin panel is equipped with robust security measures to prevent unauthorized
access and protect sensitive election data. This includes encryption protocols, access

25
control mechanisms, and audit trails to track and monitor admin activities within the
system.

5.3.3 INTEGRATION WITH EXTERNAL APIs

The integration of external APIs enhances the functionality and usability of the
online voting system by incorporating additional features and services. These APIs may
include:

5.3.3.1 SMS Notification API

An SMS notification API can be integrated to send timely updates and reminders to
voters regarding important election events, such as voter registration deadlines, voting
commencement, and result announcements. This ensures effective communication and
maximizes voter engagement.

5.3.3.2 Facial Recognition API

Facial recognition technology can be leveraged for user verification during the
voting process. By integrating a facial recognition API, users can verify their identities by
capturing and analyzing their facial features against pre-registered images, thereby
enhancing the security and authenticity of the voting process.

5.3.4 SYSTEM SECURITY

Ensuring the security of the online voting system is paramount to safeguarding the
integrity and confidentiality of the electoral process. Several security measures are
implemented to mitigate potential threats and vulnerabilities:

5.3.4.1 Encryption Techniques

26
Sensitive data transmitted within the voting system, such as voter credentials, ballot
information, and election results, are encrypted using robust encryption algorithms (e.g.,
AES) to prevent unauthorized access and data breaches.

5.3.4.2 User Authentication

User authentication mechanisms, including username/password authentication,


MFA, and biometric authentication, are employed to verify the identities of voters and
prevent unauthorized access to the system.

5.3.4.3 Access Control

Granular access control policies are implemented to restrict access to system


resources based on user roles and permissions. Admins have elevated privileges to
perform administrative tasks, while regular users are granted limited access to voting
functionalities.

5.3.5 SCALABILITY AND FUTURE ENHANCEMENTS

The Online Voting System is built with scalability at its core, featuring a modular
and flexible architecture that can effortlessly accommodate a growing user base and
evolving requirements. Leveraging cloud-based infrastructure and scalable database
solutions, the system can dynamically allocate resources to handle increased workload
and ensure optimal performance during peak usage periods.

5.4 METHODOLOGIES USED

In the Online Voting System, several algorithms play a crucial role in ensuring the
security, integrity, and functionality of the platform. This section explores the algorithms
employed, including encryption algorithms for data protection and face recognition
algorithms for user verification.

27
5.4.1 AES (Advanced Encryption Standard)

AES, also known as Rijndael, is a symmetric encryption algorithm widely adopted


for securing sensitive data in various applications, including the Online Voting System.
AES operates on blocks of data and supports key sizes of 128, 192, and 256 bits.

The algorithm comprises several key steps, including SubBytes, ShiftRows,


MixColumns, and AddRoundKey, executed in multiple rounds based on the key size.

Encryption Process:

1. Key Expansion: The AES key undergoes an expansion process to generate


round keys used in each encryption round.
2. Initial Round: The input data undergoes an initial transformation, including
SubBytes, ShiftRows, and AddRoundKey operations.
3. Rounds: Multiple rounds of SubBytes, ShiftRows, MixColumns, and
AddRoundKey operations are applied to the data.
4. Final Round: The final round excludes the MixColumns operation and
concludes with the AddRoundKey operation.

Decryption Process:

The decryption process in AES mirrors the encryption process, albeit in reverse
order. The inverse operations of SubBytes, ShiftRows, MixColumns, and AddRoundKey
are applied to recover the original plaintext from the encrypted data using the same key.

AES is utilized in the Online Voting System to encrypt sensitive data stored in the
database, such as voter credentials, ballot information, and election results. By employing
AES encryption, the system ensures data confidentiality and mitigates the risk of
unauthorized access or tampering.

28
In conclusion, the use of the Advanced Encryption Standard (AES) algorithm is
essential for encrypting data before storing it in a database. This encryption plays a critical
role in protecting the database from external attacks, ensuring the security and
confidentiality of sensitive information.

5.5 RESULTS

5.5.1 Before Casting Vote

The voting casting page displays candidate names and options for selection. Users
can choose their preferred candidates or options by clicking checkboxes or radio buttons.
Then voter need to verify their face for security purposes, by clicking the provided link.
The face should match with the image given during the registration.

Figure 5.5.1 Before Casting Vote – During election

29
5.5.2 After Casting Vote

After casting your vote, you'll see a confirmation page confirming your selection.
This page will display the candidate or option you voted for. Once the ballot gets
submitted, you can only view your vote. You can’t be able to change or delete the vote
casted.

Additionally, when Admin ends the election, you can get a message displaying
voting ended, you are late to cast your vote.

Figure 5.5.2 After Casting Vote

30
5.5.3 Admin Dashboard

The admin dashboard page provides a centralized interface for managing various
aspects of a system or platform. It typically shows number of positions, candidates, total
voters, voters voted and allows administrators to perform tasks such as voter management
and system configuration.

Admin has the privileges to Start/End the elections. From the registered voters,
admin should validate the eligible voters before starting the Election.

Figure 5.5.3 Admin Dashboard

31
5.5.4 Results after Election

After election, an information message will be sent to all the voters, with the
link to view the results. The result page displays the number of votes along with the
candidates, in the decreasing order with candidates with higher votes will be listed in the
top of the table.

Figure 5.5.4 Results after Election

32
CHAPTER 6

CONCLUSION

6.1 CONCLUSION

In conclusion, the implementation our system offers numerous benefits for modern
democracies. By leveraging digital technology, our system enhances accessibility,
convenience, and inclusivity in the electoral process. They enable voters to cast their
ballots securely from anywhere, reducing barriers such as geographical constraints and
mobility issues. Our system can streamline the voting process, leading to faster results and
increased voter turnout. It is crucial to address potential concerns regarding security,
privacy, and integrity to maintain trust in the electoral process. Robust encryption,
authentication measures are essential and taken for safeguarding against cyber threats and
ensuring the credibility of online voting. Overall, with proper safeguards in place, our
system have the potential to revolutionize democracy by making it more accessible,
efficient, and transparent.

6.2 FUTURE ENHANCEMENTS

Future enhancements for online voting systems could include implementing


blockchain technology for enhanced security and transparency, incorporating biometric
authentication to further ensure the integrity of voter identities, developing user-friendly
mobile applications to increase accessibility and participation, integrating AI algorithms
for real-time fraud detection and prevention, and leveraging encrypted protocols to
safeguard voter privacy and data integrity throughout the voting process. These
advancements aim to address concerns regarding security, accessibility, and trust in online
voting systems, ultimately promoting greater democratic participation and confidence in
electoral processes.

33
REFERENCES

1. A.Walake and P. Chavan, (2015) “Efficient Voting System with (2,2) Secret Sharing
Based Authentication”, International Journal of Computer Science and Information
Technologies, vol. 6, no. 1, pp. 410-412.
2. D. Bernhard, V. Cortier, and D. Galindo, (2012) "Formal Analysis of Helios:
Verifiability and Coercion-Resistance for Helios Voting", Proceedings of the 2012
IEEE Symposium on Security and Privacy.
3. D. Springall et al.,(2011) “Security Analysis of the Estonian Internet Voting System”
in CCS'14, Scottsdale, Arizona, USA, Nov. 3-7, 2014, ACM, 978-1-4503-2957.
4. Essex,(2014) "Internet Voting: A Modern Turnout", Electoral Studies, vol. 36, pp.
161-171.
5. H. Pan, E. Hou, and N. Ansari, (2011) “Ensuring Voters and Candidates'
Confidentiality in E-voting System”, IEEE, 978-1-61284-680.
6. Idongesit E. Eteng, Ugochi D. Ahunanya and Paul U. Umoren (May 2018),” An
Online Voting System for Colleges and Universities: A Case Study of National
Association of Science Students (NASS), University of Calabar”, University of the
West of Scotland, School of Computing
7. J. Benaloh, (2007) "Simple Verifiable Elections", Proceedings of the 16th USENIX
Security Symposium.
8. M. Ryan and P. Y. A. Ryan, (2007) "Modelling and Analyzing E-voting Systems",
International Conference on Computer Security.
9. M. Volkamer, (2013) "Voting Technologies and Trust", International Conference on
Trust and Trustworthy Computing.
10.Nikhil Ranjan (2023),”Enhancing Voting Security and Efficiency: An Electronic
Voting Machine (EVM) System Integrated With Biometric Identifiers”, Journal of
Computers Mechanical and Management 2(3):9-15

34
11. Nikita Chaudhari, Vikram Shinde, Nikita Gajare, Prajakta Suryawanshi, Sushma
Bhosale(May 2021)”E-Voting: The Next Generation Election”
12.S.M. Jambhulkar, J.B. Chakole, and P.R. Pardhi, (2014) “A Secure Approach for Web-
Based Internet Voting System using Multiple Encryption”, International Conference on
Electronic Systems, Signal Processing & Computing Technologies, pp. 371-375.
13.V. Patel, J. Jadeja, K. Patil, and K. Rai, (June 2020) "Digital Voting", International
Research Journal of Modernization in Engineering Technology and Science, vol. 2, pp.
145-155.

35
APPENDIX 1.1

IMPLEMENTATION

SOURCE CODE:

5.4.2 Index.php

<?php
session_start();

if (isset ($_SESSION['admin'])) {
header('location: admin/home.php');
}

if (isset ($_SESSION['voter'])) {
header('location: home.php');
}
?>

<?php include 'includes/header.php'; ?>


<?php include 'includes/conn.php'; ?>

<body class="hold-transition login-page">

<style>
.login-box{
margin-top:40px ;
margin-bottom: 40px;
}

36
.login-logo {
font-size: 30px;
margin-top: 25px;
}

.sub-name {
color: #563D7C;
font-size: 28px;
}

@media only screen and (min-width: 768px) {

.login-logo {
font-size: 38px;
margin-top: 30px;
}

.sub-name {
color: #563D7C;
font-size: 35px;
}
}
</style>

<div class="login-logo">
<b>Online Voting System <span class="sub-name">
&nbsp;User/Citizen login form</span></b>
</div>
<div class="login-box">

37
<div class="login-box-body">
<p class="login-box-msg">Sign in to start your Session</p>

<form action="login.php" method="POST">


<div class="form-group has-feedback">
<input type="text" class="form-control"
name="voters_key" placeholder="Voter's Key" required>
<span class="glyphicon glyphicon-user form-
control-feedback" style="transform: scale(1.2);"></span>
</div>
<div class="form-group has-feedback">
<input type="password" class="form-control"
name="password" placeholder="Password" required>
<span class="glyphicon glyphicon-lock form-
control-feedback" style="transform: scale(1.2);"></span>
</div>
<div class="form-group has-feedback text-center">
<?php
$sql = "SELECT name FROM captcha ORDER
BY RAND() LIMIT 1";
$vquery = $conn->query($sql);
if ($vquery) {
$row = $vquery->fetch_assoc();
$captchaName = $row['name'];
echo "<img src='./captcha/$captchaName'
alt='Captcha Image' height='35px'><br/><br/>";
} else {
echo "Error fetching captcha image";
}
?>

38
<input type="text" class="form-control "
name="captcha" placeholder="Enter Captcha" required>
<input type="hidden" name="captchaName"
value="<?php echo $captchaName; ?>">

</div>

<div class="row">
<div class="col-xs-4 col-xs-offset-4">
<button type="submit" class="btn btn-
primary btn-block btn-rounded" name="login"><i
class="fa fa-sign-in"></i>
&nbsp; Sign In</button>
</div>
</div>
</form>
</div>
<?php
if (isset ($_SESSION['error'])) {
echo "
<div class='callout callout-danger text-center mt20'>
<p>" . $_SESSION['error'] . "</p>
</div>
";
unset($_SESSION['error']);
}
?>
<div style="font-size: 16px; padding-top:10px">
<p>

39
<center><b>NOTE:</b> To register <a
href="register.php">Click here</a>.
</center>
</p>
<br>
</div>
</div>

<?php include 'includes/footer1.php' ?>


<?php include 'includes/scripts.php' ?>
</body>

</html>

5.4.3 login.php

<?php

session_start();

include 'includes/conn.php';

include './encryption.php'; ?>

<?php

if (isset($_POST['login'])) {

// Debugging: Check if the form data is being received

var_dump($_POST);

40
$voters_key = $_POST['voters_key'];

$password = $_POST['password'];

$captcha = $_POST['captcha'];

$captchaName = $_POST['captchaName'];

// Fetch all records from the database

$sql = "SELECT * FROM voters";

$result = $conn->query($sql);

if ($result === false) {

// Debugging: Check for SQL errors

echo "SQL Error: " . $conn->error;

exit();

// Loop through each record

else{

while ($row = $result->fetch_assoc()) {

// Decrypt the encrypted data from the current record

$decrypted_voters_key = decryptData($row['voters_key']);

$decrypted_password = decryptData($row['voterid']);

41
// Compare decrypted data with user input

if ($voters_key == $decrypted_voters_key && $password == $decrypted_password)


{

// If match found, set session and redirect

if($captchaName == $captcha . '.jpeg'){

$_SESSION['voter'] = $row['id'];

else{

$_SESSION['error'] = 'Incorrect Captcha';

else{

$_SESSION['error'] = 'Incorrect User Credentials';

else {

$_SESSION['error'] = 'Input voter credentials first';

42
}

header('location: index.php');

?>

5.4.4 register.php

<?php include 'includes/header.php'; ?>


<?php include 'includes/conn.php'; ?>
<?php include './encryption.php'; ?>
<?php session_start(); ?>

<body class="hold-transition register-page">


<style>
.register-logo {
font-size: 30px;
margin-top: 25px;
}

.login-box{
margin-top:40px ;
margin-bottom: 40px;
}

.sub-name {
color: #3A833A;
font-size: 28px;
}

43
@media only screen and (min-width: 768px) {

.register-logo {
font-size: 38px;
margin-top: 40px;
}

.sub-name {
color: #3A833A;
font-size: 38px;
}

}
</style>
<div class="register-logo">
<b>Online Voting System <span class="sub-name"> &nbsp;User
Registration form</span></b>
</div>
<div class="login-box">
<div class="register-box-body">
<p class="register-box-msg">Enter your details to register</p>
<form id="myForm" method="POST" enctype="multipart/form-data"
action="validation.php">
<div class="form-group has-feedback">
<input type="text" class="form-control" name="fname"
placeholder="First Name" required>

44
<span class="glyphicon glyphicon-user form-control-
feedback" style="transform: scale(1.3); "></span>
</div>
<div class="form-group has-feedback">
<input type="text" class="form-control" name="lname"
placeholder="Last Name" required>
<span class="glyphicon glyphicon-user form-control-
feedback" style="transform: scale(1.3); "></span>
</div>
<div class="form-group has-feedback">
<!-- <span> Date of Birth </span> -->
<input type="text" class="form-control" name="dob"
placeholder="Date of Birth (YYYY-MM-DD)"
required>
<span class="glyphicon glyphicon-calendar form-control-
feedback"
style="transform: scale(1.3); "></span>
</div>
<div class="form-group has-feedback">
<input type="text" class="form-control" name="mobile"
placeholder="Mobile Number" required>
<span class="glyphicon glyphicon-phone form-control-
feedback" style="transform: scale(1.3);"></span>
</div>
<div class="form-group has-feedback">
<input type="text" class="form-control" name="aadhar"
placeholder="Aadhar Number" required>

45
<span class="fa fa-id-card form-control-feedback"
style="transform: scale(1.3);"></span>
</div>
<div class="form-group has-feedback">
<input type="text" class="form-control"
id="uppercaseInput" name="voterid" placeholder="Voter ID" required>
<span class="fa fa-id-card-o form-control-feedback"
style="transform: scale(1.3);"></span>
</div>
<div class="form-group has-feedback">
<label for="photo">Select your Image (size between
500KB and 3 MB) :</label><br />
<input type="file" class="form-control"
id="photo" name="photo" required accept="image/*"
style="outline: none;cursor:pointer">
<span class="glyphicon glyphicon-user
form-control-feedback"
style="transform:
scale(1.3);"></span><br>
<p><b> Note : </b> This image will be used for verification before voting. So upload
only passport size clear image (size between 300KB and 3 MB). </p>
</div>

<div class="form-group has-feedback text-center">


<?php
$sql = "SELECT name FROM captcha ORDER BY
RAND() LIMIT 1";
$vquery = $conn->query($sql);

46
if ($vquery) {
$row = $vquery->fetch_assoc();
$captchaName = $row['name'];
echo "<img src='./captcha/$captchaName'
alt='Captcha Image' height='35px'><br/><br/>";
} else {
echo "Error fetching captcha image";
}
?>
<input type="text" class="form-control " name="captcha"
placeholder="Enter Captcha" required>
<input type="hidden" name="captchaName"
value="<?php echo $captchaName; ?>">
</div>

<div class="row">
<div class="col-xs-4 col-xs-offset-4">
<button type="submit" class="btn btn-md btn-
success btn-rounded" name="register"><i
class="fa fa-sign-in"></i> &nbsp;
Register </button>
</div>
</div>
</form>
</div>
<?php
if (isset($_SESSION['error'])) {
echo "

47
<div class='callout callout-danger text-center mt20'>
<p>" . $_SESSION['error'] . "</p>
</div>
";
unset($_SESSION['error']);
}
?>
<?php
if (isset($_SESSION['success'])) {
echo "
<div class='callout callout-success text-center mt20'>
<p>" . $_SESSION['success'] . "</p>
</div>
";
unset($_SESSION['success']);
}
?>
<div style="font-size: 16px; padding-top:10px">
<p>
<center><b>NOTE:</b> To login <a href="index.php">Click
here</a>.
</center>
</p>
</div>
</div>

<?php include 'includes/footer1.php' ?>


<?php include 'includes/scripts.php' ?>

48
<script>
document.getElementById('uppercaseInput').addEventListener('input',
function(event) {
var inputText = event.target.value;
event.target.value = inputText.toUpperCase();
});
document.getElementById('myForm').addEventListener('submit', function(event) {
var mobile = document.getElementsByName('mobile')[0].value;
var aadhar = document.getElementsByName('aadhar')[0].value;
var voterid = document.getElementsByName('voterid')[0].value;
var dob = document.getElementsByName('dob')[0].value;

if (mobile.length !== 10 || isNaN(mobile)) {


alert('Mobile number should be a 10-digit number.');
event.preventDefault();
return;
}

if (aadhar.length !== 12 || isNaN(aadhar)) {


alert('Aadhar number should be a 12-digit number.');
event.preventDefault();
return;
}
if (!voterid.match(/^[a-zA-Z]{3}\d{7}$/)) {
alert('Voter ID should be 3 characters followed by 7 numbers.');
event.preventDefault();
return;

49
}
if (!dob.match(/^\d{4}-\d{2}-\d{2}$/)) {
alert('Date of Birth should be in YYYY-MM-DD format.');
event.preventDefault();
return;
}
var captchaInput = document.getElementsByName('captcha')[0].value;
var captchaName = document.getElementsByName('captchaName')[0].value;
// alert('Registration successfully completed');
});
</script>

</body>
</html>

50

You might also like