Wa0136.

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

lOMoARcPSD|27101967

Pandi project

B.Sc. Computer Science (Bharathiar University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Jai suresh ([email protected])
lOMoARcPSD|27101967

SIMPLE MOBILE COMPARISON


Project submitted to the Bharathiar University in partial fulfilment of the requirement
For the award of

BACHELOR DEGREE IN COMPUTER APPLICATIONS

Submitted by
RAMAR.P
(2022J0858)
Under the guidance of
Mrs.PRIYA DHARSHINI, M.SC., M.Phil., (Ph.D)..

DEPARTMENT OF COMPUTER APPLICATIONS

SNMV
(Shri Nehru Maha Vidyalaya)
(Affliated to Bharathiar University).
Shri Gambhirmal Bafna Nagar,
Malumachampatti
Coimbatore-641 050

APRIL-2023

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

CERTIFICATE

This is to certify that the project entitled “SIMPLE MOBILE


COMPARISON” for “SHYAM MOBILES” at COIMBATORE I done by
RAMAR.P REGNO:2022J0858 is a bonafide work done under my guidance.

Place: COIMBATORE ________________________

Date: 23/05/2022 Signature of the Guide

____________________ ______________________
Head of the department Principal

Department Seal College Seal

Submitted for the Viva-Voce Examination held on_______________________

__________________ _____________________
Internal Examiner External Examiner

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

DECLARATION

I hereby declare that the project entitled “SIMPLE MOBILE


COMPARISON” submitted to the Bharathiar University in partial fulfillment
of the requirement for the award of the Bachelor Degree in Computer
Applications is a record of original project work done by me during the period
of study in Department of Computer Applications, SHRI NEHRU MAHA
VIDYALAYA COLLEGE OF ARTS & SCIENCE, COIMBATORE. Under
the supervision and guidance of Mrs. PRIYA DHARSHINI MCA.. M.Phil.,
Assistant Professor.,

Place: COIMBATORE

Date: 10/04/2023

Signature of the Candidate

RAMAR.P

(2022J0858)

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

Acknowledgement

I express my special thanks to the Management and faculty member of (SHRI


NEHRU MAHA VIDYALAYA COLLEGE OF ARTS AND SCIENCE)
providing the opportunity to undergo the project successfully in the esteemed
institution.

I would like to express my sincere thanks our Dr. B.SUBRAMANI, M.Sc,


PGDCA, B.Ed, MCA., M.Phil, MBA, Ph.D., who has given opportunity to
complete this project in successful manner.

I am thankful to Mr. M.CHANDRAKUMAR, MCA, M.Phil. PGDCA


PGDMM.., Head of the Department of Computer Applications, who has given
me this great opportunity to do this project along with our degree.

I would also like to acknowledgement the effect to Mrs. PRIYA


DHARSHINI , MCA.. M.Phil., Assistant Professor, Department of Computer
Applications, guide for spending her valuable time in assisting guiding and
helping me in preparation of the project report

I express my gratitude to the faculty member of Computer Application for their


help and support. I am also thankful to My Parents who are the backbone in all
the endeavors.

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

CHAPTER TITLE PAGE NO

ACKNOWLEDGEMENT
Synopsis

1 INTRODUCTOIN
1.1 About The Project
1.2 System Specification
1.2.1 Hardware Configuration
1.2.2 Software Specification

2 SYSTEM STUDY
2.1 Existing System
2.1.1 Drawbacks
2.2 Proposed System
2.2.1 Features

3 SYSTEM DESIGN &DEVELOPEMENT


3.1 Input Design
3.2 Output Design
3.3 Database Design
3.4.1 Description of Modules
(Detailed explanation about the project work)

4 TESTING AND IMPLEMENTATION

5 CONCLUSION

Bibliography

Appendices
A. Data Flow Diagram
B. Table Structure
C. Sample Coding
D. Sample Input
E. Sample Output

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

SYNOPSIS:
This simple project is entitled Mobile Comparison Website. This is a
simple web-based application that was developed using PHP and MySQL
Database. This project is a simple Content Management System (CMS) that
allow the users to compare the specification of the smartphones. The contents in
the system are dynamic which means they can be managed or modified in the
front-end. This has a pleasant user interface using the Bootstrap and AdminLTE
Template. Also, it has user-friendly features and functionalities.

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

1. INTRODUCTION

1.1 OVERVIEW OF THE PROJECT

This project is entitled as Simple Mobile Comparison which has


developed in PHP as front and MySQL server as back end.

The Simple Mobile Comparison is a web based system that is made up of PHP,
MySQL for the database. This Simple Mobile Comparison that allow the user to
compare the soecification of the smartphones. This has a pleasant user interface
usind he Booststrap and Admin Template,Also,it has user-friendly features and
functionalities.

Front end : HTML,CSS,PHP

Backend : My SQL

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

1.1 ORGANIZATION PROFILE

Welcome to motor pump shop since their establishment in 1990, Mr. Radha
Krishnan was founded it has gained a no of clients as their valued customers.
Motor pump shop is supplying of monoblock, open-well, self-priming,
submersible.

Which is a well established motor pump shop in coimbatore . They provide high
quality products cable and panel board other household motor can buy with best
price. Our Unique is warranty service and replacement of motor pump products
with best offers .

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

1.2 SYSTEM SPECIFICATION

1.2.1 HARDWARE SPECIFICATION

Platform : Windows 7

System : Dual core processor

Ram : 2 GB

Hard disk : 250GB

Processor : Intel core i3

1.2.2 SOFTWARE SPECIFICATION

Operating System : Window 7& above

Scripting Language : PHP 5

Database : MYSQL 5.3

Web Browser : Mozilla, Google Chrome, IE8, OPERA

Software : XAMPP Server(Version 3.3.4)

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

2. SYSTEM ANALYSIS

2.1 EXISTING SYSTEM

The “Mobile Comparison Website” is developed according the current


need in different Fields. This is Mobile Comparison Website which provides
facility for purchasing Mobiles and many more items. So by using this Mobile
Comparison Website users which want to purchase some products will first
Register an account on this portal then Login through their Username and
Password, and then Select items which they want to purchase and add them to
cart and finally checkout by giving payment details. So by using this portal
users can easily purchase products from their home.

DRAWBACKS OF EXISTING SYSTEM

 Lack of privacy
 Risk in the management of the data.
 Less Security
 Less User-friendly
 Accuracy not guaranteed
 Not in reach of distant users.

10

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

2.2 PROPOSED SYSTEM

Compare the latest mobiles and upcoming mobiles on


Gadgets Now on the basis of price and specifications. The compare feature on
our website helps you in selecting the best smartphone that suits your
requirements in the shortest amount of time. So go ahead, do the comparison,
and buy the best smartphone.

ADVANTAGES OF PROPOSED SYSTEM

The Project has several features and easy to manage.

 The System is user friendly.


 Cost effective.
 Back up support.
 Secured Data.

11

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

ABOUT THE SOFTWARE

FRONT END

PHP

PHP is a powerful server-side scripting language for creating dynamic


and interactive websites. PHP widely used; free and efficient alternative to
competitors such as Microsoft’s ASP.PHP is perfectly suited for Web
development and can be embedded directly into the HTML code. The PHP
syntax is similar to pearl and C.

PHP is open source that it is readily available and absolutely free.


Stability, flexibility and speed are chief qualities that attract to choose PHP.PHP
have multiple extensions and is extremely scalable.

SERVER-SIDESCRIPTING

This server-side scripting is the most traditional and main target field for
PHP. Programmer needs three things to make this work. Programmer need to
run the web server, with a connected PHP installation. Programmer can access
the PHP program output with a web browser, viewing the PHP page through the
server.

COMMAND LINE SCRIPTING

Programmer can make a PHP script to run it without any server or


browser. Programmers only need the PHP parser to use it this way. This type of

12

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

usage is ideal for scripts regularly executed using croon (on*nix or Linux) or
Task Scheduler (on Windows). These scripts can also be used for simple text
processing tasks.

FEATURES OF PHP

 PHP runs on different platforms (Windows, Linux, UNIX, etc.)


 PHP is compatible with almost all servers used today.

 PHP is free to download from the official PHP resource.

BACK END

MySQL

MySQL is an open-source relational database management system


(RDBMS), is developed, distributed and supported by MySQL. MySQL is a
popular choice of database for use in web applications MySQL can be scaled by
deploying it on more powerful hardware, such as a multi-processor server with
gigabytes of memory. MySQL is easy to use, yet extremely powerful, secure,
and scalable. And because of its small size and speed, it is the ideal database
solution for Web sites.

MySQL IS A DATABASE MANAGEMENT SYSTEM

A database is a structured collection of data. It may be anything from a


simple shopping list to a picture gallery or the vast amount of information in a
corporation network. To add, access and process data stored in a computer
database we need a database management system such as MYSQL server. Since

13

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

computers are very good at handling large amount of data, database


management system plays a central role in computing.

MySQL IS A RELATIONAL DATABASE MANAGEMENT SYSTEM

A relational database stores separate data in separate tables rather than


putting all the data in one big storeroom. This adds speed and flexibility. The
SQL part of “MYSQL” stands for “Structured Query Language”. SQL is the
most common standardize language used to access database and is defined by
the ANSI/ISO SQL standard. The SQL standard has been evolving since 1986
and several versions exist.

MySQLSOFTWARE IS OPEN SOURCE

Open source means that it is possible for anyone to use modify the
software. Anybody can download the MYSQL software uses the GPL (GNU
General Public License), to define what we may and may not use do with the
software.

MySQLSERVER WORKS IN CLIENT

The MySQL database software is a client/server system that consists of a


multi-threaded SQL server that supports different backend, several different
client programs and libraries, administrative tools and a wide range of
Application Programming Interface (APIs).

A large amount of contributed MySQL software is available: Modern day


websites seem to be relying more and more on compel the Structured Query
Language is a very popular database language, and its standardization makes it

14

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

easy to store, update and access data. One of the most powerful SQL servers out
there is called MySQL and surprisingly enough, it’s free.

Some of the features of MySQL include: Handles large databases, in the


area of 50,000,000+records. No memory leaks. Tested with a commercial
memory leakage detector (purify). A privilege and password system which is
very flexible and secure, and which allows host-based verification. Passwords
are secure since all password traffic when connecting the server is encrypted.

FEATURES OF MySQL CLIENT/SERVER ARCHITECTURE

MySQL is a client/server system. There is a database server (MySQL)


and arbitrarily many clients (application programs), which communicate with
the server. The clients can run on the same computer as the server or on another
computer.

SQL COMPATIBILITY

As before said SQL is a standardized language for querying and updating data
and for the administration of a database. Through the configuration setting sol-
mode we can make the MySQL server behave for the most part compatibly with
various database systems.

STORED PROCEDURES

Stored procedures (SPs for short) are generally used to simplify steps
such as inserting or deleting a data record.

TRIGGERS

Triggers are SQL commands that are automatically executed by the server
in certain database operations INSERT, UPDATE, and DELETE, MYSQL has
supported triggers.
15

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

REPLICATION

Replication allows the contents of a database to be copied (replicated)


onto a number of computers to increase protection against system and to
improve the speed of database queries.

PLATFORM INDEPENDENCE

MySQL can be executed under a number of operating systems. The most


important are Apple Macintosh OS X, Linux, Microsoft Windows, and the
Unix.

SPEED

MySQL is considered a very fast database program.

16

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

3.SYSTEM DESIGN

3.1 FILE DESIGN

A database is a collection of interrelated data stored with minimum


redundancy to serve many users quickly and efficiently. The general objective to
make information access easy, quick, inexpensive and flexible for user.

 Control redundancy
 Easy of learning and use

 Data independency

 Accuracy and integrity

 Recovery from failure

 Privacy and security.

3.2 INPUT DESIGN

Input design is one of the most important phase of the system design.
Input design is the process where the input received in the system are planned
and designed, so as to get necessary information from the user, eliminating the
information that is not required. The aim of the input design is to ensure the
maximum possible levels of accuracy and also ensures that the input is

17

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

accessible that understood by the user. The input design is the part of overall
system design, which requires very careful attention. if the data going into the
system is incorrect then the processing and output will magnify the errors.

3.3 OUTPUT DESIGN

Output design is very important concept in the computerized system,


without reliable output the user may feel the entire system is unnecessary and
avoids using it. The proper output design is important in any system and
facilitates effective decision-making. The output design of this system includes
various reports.Computer output is the most important and direct source of
information the user. Efficient, intelligible output design should improve the
system’s relationships with the user and help in decision making. A major form
of output is the hardcopy from the printer.

3.4 DATABASE DESIGN

Software design sits at the technical kernel of the software


engineering process and is applied regardless of the development paradigm and
area of application. Design is the first step in the development phase for any
engineered product or system. The designer’s goal is to produce a model or
representation of an entity that will later be built. Beginning, once system
requirement have been specified and analyzed, system design is the first of the
three technical activities -design, code and test that is required to build and
verify software.The importance can be stated with a single word “Quality”.
18

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

Design is the place where quality is fostered in software development. Design


provides us with representations of software that can assess for quality. Design
is the only way that we can accurately translate a customer’s view into a
finished software product or system. Software design serves as a foundation for
all the software engineering steps that follow. Without a strong design we risk
building an unstable system – one that will be difficult to test, one whose quality
cannot be assessed until the laststage.

3.5 SYSTEM DEVLOPMENT

3.5.1 MODULE :

DESCRIPTION OF THE MODULE

Module:

Admin-Side

 Secure Login and Logout


 Dashboard

 Display the summary of lists.

 Categories Management

 Add New Category

 List All Categories

 Update Category

 View Category

 Delete Category

19

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

 Fields Management

 Add New Field

 List All Fields

 Update Field

 View Field

 Smart Phones Management

 Add New Smart Phone

 List All Smart Phones

 Update Smart Phone

 View Smart Phone Details

 Delete Smart Phone

 Manage User List (CRUD)

 Manage Account Details/Credentials

 Manage System Information

Public-Side:

 List All Smart Phones


 Search Smart Phones

 Read the SmartPhone Article and Specifications

 Compare Smart Phones

20

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

 Read 'About Us' Content

Module description:

 Admin login:
o It has an admin account that controls the whole system. Admin has
the control to give access to employee in the system.
 Comparison system:
o It compares the two cars features and characteristics as asked by
user.
 Accessories option:
o It also provides varieties of accessories available with the cars.
 Feedback form:
o User can provide reviews and feedback for particular car.
 Enquiry form:
o If user has some confusion he can query the same in enquiry form.
The form is then sent to admin.

4.SYSTEM TESTING AND IMPLEMENTATION

4.1SYSTEM TESTING

UNIT TESTING

Unit testing focuses on the verification of smallest unit of software design


of the module. To check whether each module in the software works properly so
that it gives desired outputs to the given inputs. All validations and conditions
are tested in the module level in unit test. Control paths are tested to ensure the
information properly flows into and out of the program unit under test.
Boundary condition are tested to ensure that the modules operates at boundary
establishes to restrict processing. All independent paths through control
structure are exercised to ensure that all statements in a module have been
executed at least once. And finally all errors handling paths are tested.

BLACK BOX TESTING

Black Box Testing methods focus on the functional requirements of the


software. This testing enables the software engineer to derive sets of input
conditions that will fully exercise all functional requirements for a program.

21

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

These testing attempts to find errors in the following categories: incorrect or


missing functions, interface errors, errors in data structure or external database
access, performance errors and initialization errors and termination errors. In
our system, Black Box testing has been successfully handled. The test input data
was given has got desired output.

INTEGRATION TESTING

Integration Testing is a systematic technique for constructing the program


structure, while conducting test to recover errors associated with interfacing.
The problem is interfacing data can be lost across an interface, one module can
have an inadvertent, adverse effect on another sub functions, when combined
may not produce the expected major function. Global data structure can present
problems in the testing when all modules are combined and entire program is
tested as a whole.The second step in the testing process is the Integration
testing. Integration testing is the systematic technique for constructing the
program structure while conducting tests to uncover errors associated with
interfacing. All the modules when unit testing will work properly but after
interfacing the data can be lost across an interface, one module can have an
inadvertent, adverse effect on other, sub functions when combined may not
produce the desired major function, global data structures can cause problems,
etc.

USER ACCEPTANCE TESTING

The performance of user interactive testing is actually the user show. The
user gives live data and checks whether software is giving specified outputs.
User acceptance test of a system is the factor for the success of the system. The
system under consideration was listed for user acceptance by keeping constant
touch with the perspective user of the system at the time of design, development
and making changes whenever required for unit testing.The requirements of the
customer are gathered at regular intervals at the developing site itself.

FUNCTIONAL TESTING

The total processing of the system is satisfactory with the following


results.This test involves testing the system under typical operating conditions
with sample input values. Functional testing was performed on the system by
giving existing industry id or plot number and a null or string as the input for
any field in which case the user should be redirected to the same state with the
appropriate message, rather than proceeding and crashing in the
system.Functional testing was performed on the system by raising the demand
22

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

with an eye to check all the validations. All the validations are clearly notified
to the user regarding jobseekers reg, new client reg, job order, job providers,
and job search preparation etc.

4.2 SYSTEM IMPLEMENTATION

The system implemented and conversion is completed, a review of


system is usually conducted by users and analyst this is called post
implementation review. The most fundamental concern post implementation
review is determining the system has met its objective that is analyst want to
know if the performance level of the system has improved and if the system is
producing the result intended. If neither is happening, one may question whether
the system can be considered successful. By using current system, all the
requirements of all users are fulfilled. Security and authentication is maintained
in both user level as well as the management level. The data is stored in is
highly reliable and simpler to use, the user level security is managed with the
help of password options and sessions, which finally ensures that all the
transactions are made securely.

SYSTEM MAINTENANCE

23

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

The maintenance phase of the software life cycle is the time period in
which a software product performs useful work. For maintaining this system
properly the following points are to be followed strictly. The executable file of
forms and repots are given to the end users. Also the backup should be taken in
order to safe guard the system. Maintenance activities involve making
enhancement to software products, adapting products to new environment and
correction problems. Software product enhancement may involve providing
new functional capabilities, improving use displays and modes of interaction,
upgrading external documents and internal documentation or upgrading the
performance characteristics of a system.

Adaptation of software to a new environment may involve moving


software to a new environment, faces a lot of maintenance problems. Problem
correction involves modification and revalidation of software to correct errors.
Some errors require immediate attention and some others can be corrected on a
scheduled, periodic basis, and others are known but never corrected. Therefore
greater care should be taken in software development that leads to the
production of maintainable systems.

Software maintenance is a microcosm of software


development cycle. Enhancement and adaptation of software, reinitiates
development in the analysis phase while correction of a software problem may
reinitiates then development cycle in the analysis phase, design phase or
implementation phase. Thus all the tools and techniques used to develop
software are potentially useful for software maintenance.

24

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

5. CONCLUSION AND FUTURE ENHANCEMENT

5.1 CONCLUSION

 System helps to store all the data about the customer order in computer
and there is no need to do paper work.
 Data is going to be preserved carefully for longer period hence proper
backup is required otherwise there is chance of losing entries or data.

5.2 FUTURE SCOPE AND ENHANCEMENT

Being a computer system, the system has good scope to be improved


further.

Future Enhancements are as listed below

25

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

 Maintain daily employee attendance.


 Administrator can be given more rights so that he will be able to change
order details.

6.BIBLIOGRAPHY

REFERENCE BOOKS

 Thomas Powell, “HTML & CSS: The Complete Reference”,


McGraw-Hill, 5th Edition, 2002.
 Jason Smith, “Build and Design A Website (HTML & CSS)”, EBook.

 Ian Lloyd, “Build Your Own Website the Right Way Using HTML & CSS”,
3rd Edition, Site Point, 2011.

 Ian Sommerville, “Software Engineering (International Computer


Science Series)”, Hardcover, 7th Edition, 2004.

 5. Andy Harris,“PHP 5 / MySQL Programming for the Absolute


Beginner”, 1st edition , Cengage Learning PTR, 2004.

WEBSITES

26

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

 www.w3schools.com/PHP/

 www.computerhope.com/starthtm.htm

 www.webdesign.about.com/od/webdesignbasics/u/webdesignbasics.h.

 www.w3schools.com/php/php_mysql_intro.asp

APPENDCIES

A. DATA FLOW DIAGRAM

LEVEL 0

Mobile
Comparison
Admin Field_list_db
Website
Login

27

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

LEVEL 1

Admin

Manage
Users user_db

Manage
Category_db
Category

List

Enquiry View Field_db


Field list

Enquiry

28

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

Manage
Mobile_db
Mobile
list

Enquiry

ENTITY RELATIONSHIP DIAGRAM

u- Pro-pri
a-id name Pro-
Pwd
ava
U- Pro-name
B-name
name Admin
Ct- Pro-
U- no Pro-
img3
id id
User Manag Product
m-
e 1
pwd
Add e-id Pro- charg
r Pro-rev-id quality img1 e
Pro-
Pro- des
productid
img2
Price Pro-pri-bef
Product reviews
summary searc
value h

ReviewDat Name Order-


e review 29 u-id
id

vie OrderHistory postingDat store


order
remark status Pro-id Pay-m
w Order-
Order-id Downloaded by Jai suresh ([email protected]) Order- qu
e
lOMoARcPSD|27101967

30

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

B.TABLE STRUCTURE:

Table Name: Admin_Detail

Primary key : a_id

Field Type Description


varchar
u_name Specifies the Username
(10)
varchar
pwd Password
(10)

Table Name: Table category_list_Detail

Primary key : cat_id

Field Type Description


cat_id varchar (11) categoryid
name varchar (10) Name
description varchar (11) Description
order_by varchar (11) Order by
status varchar (11) Status
delete_flag varchar (11) Delete flag

Table Name : field_list Detail

Primary key : u_id

Field Type Description


User_id varchar (11) user Id
category_id varchar (11) Category id
name varchar (11) Name
description varchar (11) Description
order_by varchar (11) Order by
status varchar (11) Status
delete_flag varchar (11) delete_flag

31

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

Table Name: Table mobile_list_Detail

Primary key : mobile_id

Reference key: mobile_id

Field Type Description

mobile_id varchar mobile_id


(11)
model varchar Model
(11)
brand varchar Brand
(11)
display_conten varchar Display content
t (11)
thumbnail_path varchar Thumbnail path
(11)
status varchar Status
(11)

Table Name: Tablmobile_met_Detail

Primary key : Enq_id

Field Type Description

varchar
mobile_id Mobile id
(11)
varchar
field_id Field id
(11)
varchar
meta_value Meta value
(25)

32

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

C. SAMPLE CODING
<?php
session_start();
error_reporting(0);
include("include/config.php");
if(isset($_POST['submit']))
{
$username=$_POST['username'];
$password=md5($_POST['password']);

33

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

$ret=mysqli_query($con,"SELECT * FROM admin WHERE


username='$username' and password='$password'");
$num=mysqli_fetch_array($ret);
if($num>0)
{
$extra="change-password.php";//
$_SESSION['alogin']=$_POST['username'];
$_SESSION['id']=$num['id'];
$host=$_SERVER['HTTP_HOST'];
$uri=rtrim(dirname($_SERVER['PHP_SELF']),'/\\');
header("location:http://$host$uri/$extra");
exit();
}
else
{
$_SESSION['errmsg']="Invalid username or password";
$extra="index.php";
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']),'/\\');
header("location:http://$host$uri/$extra");
exit();
}
}
?>

<!DOCTYPE html>
<html lang="en">
<head>

34

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Shopping Portal | Admin login</title>
<link type="text/css" href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link type="text/css" href="bootstrap/css/bootstrap-responsive.min.css"
rel="stylesheet">
<link type="text/css" href="css/theme.css" rel="stylesheet">
<link type="text/css" href="images/icons/css/font-awesome.css"
rel="stylesheet">
<link type="text/css" href='http://fonts.googleapis.com/css?
family=Open+Sans:400italic,600italic,400,600' rel='stylesheet'>
</head>
<body>

<div class="navbar navbar-fixed-top">


<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".navbar-inverse-
collapse">
<i class="icon-reorder shaded"></i>
</a>
<a class="brand" href="index.html">
Shopping Portal | Admin
</a>
<div class="nav-collapse collapse navbar-inverse-collapse">
<ul class="nav pull-right">
<li><a href="http://localhost/shopping/">
Back to Portal
</a></li>

35

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

</ul>
</div><!-- /.nav-collapse -->
</div>
</div><!-- /navbar-inner -->
</div><!-- /navbar -->
<div class="wrapper">
<div class="container">
<div class="row">
<div class="module module-login span4 offset4">
<form class="form-vertical" method="post">
<div class="module-head">
<h3>Sign In</h3>
</div>
<span style="color:red;" ><?php echo htmlentities($_SESSION['errmsg']); ?
><?php echo htmlentities($_SESSION['errmsg']="");?></span>
<div class="module-body">
<div class="control-group">
<div class="controls row-fluid">
<input class="span12" type="text" id="inputEmail" name="username"
placeholder="Username">
</div>
</div>
<div class="control-group">
<div class="controls row-fluid">
<input class="span12" type="password" id="inputPassword" name="password"
placeholder="Password">
<div class="module-foot">
<div class="control-group">
<div class="controls clearfix">
36

Downloaded by Jai suresh ([email protected])


lOMoARcPSD|27101967

<button type="submit" class="btn btn-primary pull-right"


name="submit">Login</button>
</div><!--/.wrapper-->
<div class="footer">
<div class="container">
<b class="copyright">&copy; 2017 Shopping Portal </b> All rights reserved.
</div>
</div>
<script src="scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="scripts/jquery-ui-1.10.1.custom.min.js"
type="text/javascript"></script>
<script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
</body>

37

Downloaded by Jai suresh ([email protected])

You might also like