Professional Documents
Culture Documents
Faruq Complete Projectd
Faruq Complete Projectd
CHAPTER ONE
INTRODUCTION
In present time most families own at least one car. With a car, movement from one location to
another has been made easy. At the same time, people who own cars especially women don’t
want to have a problem with their cars as the troubleshooting of a car can be a nightmare to
them. Most of those thatowns a car don’t know how to deal with their cars whenever it has a
problem. All they know is to start the engine, press the pedal and break when they need to. They
won’t know what to do when something happens to their cars. This web-based software is hoped
to help those who need guides to deal with their car’s problems. Although it might not give a
complete guide and help as a human expert, namely mechanics, at least the expert system can
give temporary assistance to those who need instant help. Expert system has been described as a
An expert system is an advanced computer that is aimed at emulating human intelligence and
reasoning. Expert systems can be used in decision making especially in a computer-aided system
and can also provide consistent answers.Expert system is an intelligent software which works in
one field. An Expert System is also called a Knowledge Based System (KBS), it is a computer
Expert system uses knowledge and inference problem-solving capability. Knowledge that resides
in the expert system knowledge base comprises of the field facts and associated heuristics. This
knowledge is gathered from human experts who are unfortunately not accessible every time.
2
Furthermore, for some working areas, one or two experts are not sufficient, just like agriculture,
where so many fields are part of a single major field, that is why knowledge is collected from
An expert system depends on two component parts: a knowledge base and an inference engine.
A knowledge base is an orderly collection of information about the system’s domain. The
information for a knowledge base must be collected from human experts all through interviews
and observations. This information is typically represented in the form of “if-then” rules. A
major expert system's knowledge base contains thousands of rules. The facts in the knowledge
base are interpreted and calculated by an inference engine to provide a response. Usually, Tasks
for expert systems involve diagnosis, monitoring, scheduling, planning, and design for
In this era of internet, it would be nice if a web-based expert system can be developed to
diagnose mechanical and other related faults in our vehicles. If this research is completed and
implemented, it will help vehicle owners to find solutions to some common faults in their
vehicles without having to consult a motor vehicle specialist or Mechanics. Hence, save money
on maintenances since the system could render solution and some of the offer’s solution could be
carried out by non-conventional mechanics, and reduce the congestion in a mechanical workshop
as it will reduce the time spent in troubleshooting the cause of the problems in a motor vehicle.
Dealing with motor vehicle problems and fault are most times handled by mechanics. There are
times when urgent help is needed, and they might not be readily available or might cost time and
expense to get them around; this is where this expert system bridges the gap. This expert system
will serve as a first aid guide to enable users handle issues that may arise with their automobiles,
thereby saving time and cost that would have been procured and as well assist in the absence of
1.3 AIM
This research work is aimed at diagnosing common faults in a car and give a possible solution
that can be applied if the fault has been verified to be correctly determined.
1.4 OBJECTIVES
iii. Design a system to diagnose car fault and problem using inference system
iv. Design a system to provide maintenance advises to users and prevent future fault from
occurring
The research work covers the troubleshooting and recommendation of solution for millennium
This system can help inexperienced automobile repairers or drivers in diagnosing the fault of the
car.
less time.
ii. Reduces the need for skilled mechanics: The repairs of a car require a high level of
expertise. With this system, inexperienced mechanics can be guided to find the fault.
iii. Places expert knowledge into machine readable form, where it can be summoned at any
time.
5
CHAPTER TWO
The first expert system was developed in 1965 by Edward Feigenbaum and Joshua Lederberg of
Stamford University in California, US. Dendral, as their expert system was later known, was
designed to analyze chemical compounds. Expert systems now have commercial applications in
fields as diverse as medical diagnosis, petroleum engineering, and financial investing. In order to
knowledge base and an inference engine. A knowledge base is an organized collection of facts
about the system’s domain. An inference engine interprets and evaluates the facts in the
knowledge base order to provide an answer. Typical tasks for expert systems involve
endeavors. Facts for a knowledge base must be acquired from human experts through interviews
and observations.
problem-solving ability. Itis computer system that emulates the decision making ability of a
just like capturing the knowledge of humans or experts into a computerfor referencing. An expert
system is a system for problem solving and decision-making based on knowledge of its task and
The Expert System is known as an appropriate technology since it solves the issue of transferring
knowledge and expertise from highly skilled professionals to less skilled workers. It must be
6
recognized that knowledge expertise, is a scarce resources onetimes especially while on journey
or rural areas. The Expert System will help extend this valuable resource by offering vital
information that helps in time of urgent need to expert.(Philip, 2016).An Expert System is a
computer program that basically consistsof a knowledge base, an engine of control, and a user
interface. Expert systems remain aids to, rather than replacements for, human experts.
Any successful decision-making is strongly dependent uponvarious capabilities that include the
effective acquisition, storage, distribution, and sophisticated use of the knowledge of the human
(Yang and Okete2010).also said that the most successful application of Artificial Intelligence
(AI) in decision making so far is the development of Decision Support System (DSS),
decision makers.(Ricardo, 2015). Expert systems are cheaper compared to human experts in the
long-termscenario. However, expert systems are relatively costly to develop but easy, cheap
tooperate and holds quality information,(C Angeli,2010). Expert System has been applied in
many ways and various fields which are mean to make human‘s life simple and even easier. The
particularly appropriate to preserve and disseminate efficiently valuable and scarce expertise at
reasonable costs. For example, Nigeria NigComSat-1R Satellite is a critical ICT backbone
infrastructure to drive the National ICT revolution in providing revenue diversification for the
7
Nation and offering cost effective solution and affordable access to meet Nigeria
telecommunications, broadcast, aviation, maritime, defense and security needs. Once an expert
algorithms which are static in the sense that governing board ships, once determined, stay fixed
and some expert systems can a give reasons towards the given answer. (Listofcars, 2011).
Motor mechanics are involved with the servicing, maintenance, and repair of cars and light
vehicles. The work is wide ranging and includes routine servicing in accordance with
manufacturers' recommended procedures and the testing and approval of the structural,
mechanical, and electrical systems of the vehicle.A vehicle may be due for a service after it has
travelled a certain number of kilometers or after a certain period of time according to instructions
set out by the vehicle's manufacturers. The following are the work done by the mechanics
iv. Using special equipment and road tests to make sure the vehicle performs as it should
mechanical fault.
Solving these problems may involve stripping down the affected part of the car in a
workshop area, finding the faulty components and replacing them, and then putting all the
parts together again, (Jindal, 2010).Mechanics tend to replace parts rather than repair them
because this is quicker and therefore less costly. Mechanics also deal with electrical and
8
electronic systems, which are becomingmore and more sophisticated on modern vehicles. For
example, mechanics may connect laptop computers to a vehicle's electronic control unit,
using an on-screen menu tochoose the part of the vehicle they want to investigate. The
computer can find and report back informationon the fault, for example, a break in circuit
wiring. With older vehicles, mechanics use electrical testing equipment like voltmeters and
measure things likeengine and brake performance, transmission, and the accuracy of
dashboard indicators.
The first diagnostic System for technical fault troubleshooting in motor vehicles was developed
at MIT in the early 1970’s. Kadarsah in1998 proposed and designed a decision model for car
fault troubleshooting in which a system was utilized to help inexperienced mechanics and
drivers. The model consisted of inference engine, Knowledge base, database, user interaction and
adaptive mechanism. The Inference engine used backward chaining because of a small number
of outputs with many possible inputs. In additions, the adaptive mechanism was utilized in the
user interactionsection to receive feedback about system troubleshooting result. The feedback
results were stored in a database. The adaptive system then processed the stored data and extract
A car failure detection KBS was proposed by RicardoNurzal (2017). In this system, car faults
were divided into three states: Start-up state, Run-stable and Movement-state. Shell Rule based
expert system (CLIPS). With forward chaining inference engine were used in the
implementation. CLIPS stored the knowledge in rules form, which had logic-basedrepresentation
as well as the production rules. The system interacts with the user through an interface and gave
9
the troubleshooting result with illustration. The rule-based expert system contained 150 rules for
car failure causes. However, improvement in the domainknowledge and applying adaptive
Peter Nabende and Tom Wanyama, in 2018 proposed heavy Duty Diesel Engines (HDDEs)
troubleshooting. As a result, employing an expert system in such domain was highly useful.
The HDDIEs faults troubleshooting System was able to successfully detect malfunctions in the
engines and give recommendation of corrective actions. However, the proposed prototype was
not promoted to be used as a complete application due to time and resources limitations. Further
surveys were done for developing motor cultivator fault troubleshooting model. This model was
based on the Decision Support System (DSS) in which the outcome represents the input to the
DSS. The supplier selection for faulty component replacement was made by Decision Support
System(DSS) based on the outcome. It proved to be a very useful tool for equipment servicing
needs with low development cost. It increased the efficiency of labor and workers’ satisfaction.
Ahmad in 2015 built knowledge based expert system to detect car fault and diagnosis.
10
TITLE PROBLEM
SYSTEM OOTING
SYSTEM
FAILURE
DETECTIO
N KBS
11
DOMAIN DIAGNOSIS
KNOWLEDGE
THAT
REPRESENTS
DOMAIN
KNOWLEDGE
THOROUGHL
I. (2018), EFFECTIVEN
FAILURE PROCESS .
AND
DETECTIO
N SYSTEM
AND CE
MAINTENA
NCE.
DATA
G, MAINTAIN REPAIRING
FTECTION AL G
OF MACHINE ELECTRICAL
ELECTRICA S MACHINES
MACHINES
ING ER SYSTEM G IN A
N SYSTEM ENGINE
IN
14
BULLDOZE
R ENGINE
TO DETECT A E FALUT
PROBLEM IN DIAGNOSIS
PROVIDE
AVAILABLE
SOLUTION TO
THAT.
DATA
N. (2019), IN EXPLORE IN
SING SYSTEM
AUTOMOTI
VE
SYSTEM.
FOR MANAGED
TROUBLES DATABASE
HOOTING DESIGN
VEHICLES
PROBLEM
17
CHAPTER THREE
RESEARCH METHODOLOGY
This research applied theoretical methodology of case study of existing related works and review
of car faults and problem. An extensive reportof this research methods is given in Chapter two.
This chapter focuseson the car faults type approach to be adopted in the realization of the
Engine is a machine for converting any of various forms of energy into mechanical
force and motion. Engine induced faults are car problem cause by defect in the car
engine. Some of the common engine problems include oil leaks, overheating, stalling,
A fault in electrical power system can be said to be abnormal condition of the system
In motor vehicle, the clutch acts as a mechanical linkage between the engine and
transmission and separate the engine from the transmission system. It a mechanical
device which transfers the rotational power from the engine to the wheels in any
manual vehicle. Clutch related faults are fault attributed to car clutch.
18
work toslow a motor vehicle. A brake helps tostop vehicles within the smallest
possible distance.
Research methodology is referring to the means of data and information gathering for the
compilationof the project. I adopted interviewing method of fact finding in this project research
where Human Experts were interview through a form where data and information were supplied
Expert system has been in existing in various field like medicine, even in agriculture.
Majorlyautomobile based expert system that has been developed are mostly on tractors and
heavy-duty engines. This project will focus on expert system for car fault detection.
The system to be developed ‘Car FaultExpert System’ is built to enhance car fault detection and
solution. This expert system is mainly design for diagnosing car fault and problem. It was
designed to use the available information about the car’s current state like symptoms and
information. The system, therefore, needed a way of keeping its knowledge that can be retrieved
when the system was running. This need was serviced by a database system toallowfor a flexible
storage and retrieval of data.The proposed system will be web based and can be access through
19
any web browser. It takes it necessary inputs process it based on written instructions and makes
Rules-based systems (also known as production systems or expert systems) are the simplest type
of artificial intelligence and uses prescribed knowledge-based rules to solve a problem. The rule-
based method uses rules as a representation of information for the knowledge coded into the
A rule-based system is a way of encoding a human expert's knowledge in a tight field into an
automated system. A rule-based system can be literally created by using a set of assertions and a
set of rules that specify how to act on the assertion set. Rules are expressed as a set of if-then
IF A THEN B
A⇒B.
The rule-based system consistsof a set of IF-THEN rules, a set of facts, given the facts, some
interpreters controlling the applicationof the rules. The idea of an expert system is to use the
knowledge from an expert system and the code it into a set of rules. When applied to the same
data, the expert system will perform (or is programmed to achieve) in a similar way to the expert.
Rule-based systems are simple models and can be developed and applied for a large kind of
problems.The prerequisite is that knowledge of the problem area can be represented in the
formof if-then rules. Norshould the area be too wide, since a high number of rules will make the
The rule-based expert system consists of the following key elements (the five most important
i. Knowledge Base: Contains the information of the domain expressed as rules (IF-THEN
ii. Database: Consists of predicate computational facts that are consistent with the
iii. Inference Engine: Consists of all processes that manipulate the knowledge base to
discern the information needed by the user and the logic required by the expert
iv. Explanation Subsystem: Analyzes the structure of the reasoning performed by a system
and explains it all to the user, giving the user the potential to ask the systems about the
way in which a conclusion has been reached or about the facts used.
v. User Interface: Refers to interaction between a user searching for a solution and an
expert system and consists of a natural language processing system or a graphical user
vi. Knowledge Engineer: Is usually a computer scientist with Artificial Intelligence (AI)
training that also works with an expert in the field of application to represent the relevant
knowledge of the expert in a form that must be entered into the knowledge base.
vii. KnowledgeAcquisition Subsystem: Tests and updates the increasing knowledge base
User
Human Expert
User Interface
Knᴏwledge Acquisitiᴏn
Explanatiᴏn Subsystem
Knᴏwledge Base
database
Inference Engine
Knᴏwledge Engineer
Inference engine is a part of expert system that applies logical rules to the knowledge base to
deduce new information. A typical expert system consists of knowledge based and inference
engine. Knowledge based consistedof the stored fact about the field, while inference engine
consisted of logical fact apply to the knowledge based to deduce new information.
The logic that the inference use is typically represented as IF-THEN rules. The general format of
such rules is
IF<logicalexpression>
THEN<logicalexpression>.
Inference engine works in one of the two modes: forward chain or backward chain. Forward
chaining starts with the known facts and asserts new facts. Backward chaining start with goals
and works backward to determine what facts must be asserted so that goals can be achieved.
Forward chaining (or forwardreasoning) is one of the main methodsof reasoning when using an
inference engine. Forward chaining starts with the known facts and asserts new facts. Forward
chaining start with the available data and uses inference rues to extract more data until a goal is
reached. An inference engine using forward chaining searches the inference rule until it finds ne
where the antecedent (if clause) is known to be true. When such a rule is found, the engine can
conclude, or infer, the consequent (then clause), resulting in the addition of new information to
its data.
If Array [] = = symptoms
23
The dataset will be used in formulate knowledge base for the system to be able to build a robust
inference system. Data set on car faulthas been used and since getting data set car fault is almost
difficult, I engaged in using some specific attributes that was been formulated using specific
ii. Fault
iii. Causes
v. Solution
Getting rid errors that may be present in the data are parts of pre-processing task that should be
done to make the data suitable for modeling. The dataset collected from the Human Expert will
make the knowledge base. This part will focus to filter out every consistent set of data set there
This aspect of the project explains the general design interface of the project. This covers the
output design, the input design, and the database design. The necessity of those is toknow the
expected output interface from the application by the user, the medium and interface for entering
data into the system’s knowledge base, the structure the database file and the
24
Every human expert will have a registration page and a contactform to be fill through the
information is gathering aboutcar faults and problem. And every user will have a page where
The output design is the illustration or graphical presentation of the output interface and
description of the output medium employed. The media presenting the outputof the system is
either producing the output in a report formaton the screen. The output can be printed and when
searching for a particular record in the knowledge base has been made easy with the use of the
Input design shows the interface for the system and describe how data are been entered into the
Database design gives the description of the database file in terms of table and fields
specifications for keeping the input data and processed information used in formulating the
The database file “cfes.db” is develop using MySQL database application and contains three (3)
Table 3.1
expert_fname text
exepert_lname text
expert_status text
expert_c_address text
expert_phone number
expert_email email
user_name text
password text
Table 3.2
Table name: problem table primary key: problem_id foreign key: symptoms_id
fault text
causes text
symptoms_id int
solution text
26
Table 3.3
Symptoms_id number
Symptoms text
The developed CFES will be developedon sublime text with PHP, MYSQL, JAVASCRIPT,
Bootstrap CSS and HTML as the development, design used in model the knowledge based and
3.9.1 PHP
The PHP hypertext preprocessor allows web developers to create dynamic content that interact
that is especially suited for web development. PHP generally runs on web server, taking PHP
code as it input and creating web pages as output. It can also be used forcommand-line scripting
and client-side GUI applications. PHP can be deployed on most web servers, many operating
systems, and platforms, and be used with many relational database management systems. It is
available free of charge and PHP groupprovides the complete sourcecode for users to build,
3.9.2 JavaScript
This is a scripting language used to enable programmatic access toobject within other
applications. It is primarily used in the form of client-server JavaScript for the development of
27
dynamic website.
3.9.3 MySQL
query language. it is consistent fast performance, high reliability, and ease of use.
MySQL is a database. The data in MySQL is stored in database objects called tables. A table is a
CHAPTER FOUR
This page is system home page and serve for the system users. It is consisting of symptoms of
Car Fault and faults where user can select to diagnose the car fault/malfunction according to the
This is where result of the diagnosis is place, here all details of the diagnosed car fault is
i. Admin Login
This is the first page of the system; it presents the Knowledge (Knowledge engineer) with a
After successfully login into the platform, it then redirects to the admin dashboard, with options
for the following modules, Create profilefor expert, view experts, view experts post, symptoms,
This provides a form where admin enter the faults/malfuction detail into the system including the
The system requirements consist of the various tools required from the point of design and
requirement, the web client software requirement and hardware requirement are illustrated in this
section. See table forsoftware requirement, table for web client requirement and table for
hardware requirement.
Requirements Software
MySQL server
32
Requirements Software
MozillaFirefox, etc.
The hardware requirement is also presented in tabular form in the table below.
Minimum Requirement
CHAPTER FIVE
5.1 SUMMARY
The expert system was designed to detect various automobile problems instead of using human
mechanics. There is a need for maintenance and repair as well as time is deemed necessary.
Expert system is an interactive computer-based decision tool that uses both fact and heuristics to
solve difficult problem base on knowledge acquired from an expert. Expert system is used where
there is no available auto mechanic in a particular period. By giving the car owners necessary
solution, this expert system helps them to troubleshoot the faults detected through the manifested
symptoms. Also, this gives a temporary assistance to the car ownerswho need an instant help –
especially thosewho are in haste and have not enough time to wait for human expert tocome to
repair the damage. It may not have all the problems and solutions, but good news is that it is
subject toimprovement and enhancement-meaning that the web application administrators will
continue working round the clock to keep it up to date to satisfy the needs of users.
5.2 CONCLUSION
In conclusion, the automobile fault detection system is providing a temporary assistance to those
car owners who need instant help. It will help vehicle owners to diagnose and find solutions to
some faults in their vehicles without having to consult a motor vehicle specialists or mechanics.
Hence, save money on maintenances since the system could render solutions and reduce the
5.3 RECOMMENDATIONS
I recommend that the system should be integrated in other to help technicians, or users to detect a
REFERENCES
Al-Taani, A. T. (2005). An Expert System for Car Failure Diagnosis. IEC (Prague), 5, 457-560.
Gupta, R. (2015). A Simulink Modelfor an Engine Cooling System and its Applicationfor Fault
Detection in Vehicles.
Advanced Knowledge BasedSystems: Model, Applications & Research, vol. 1, P. Sajja and R.
http://www.tmr_ndia.org/eseries/ebook.html#content
Lanigan, P. E., Kavulya, S., Narasimhan, P., Fuhrman, T. E., & Salman, M. A. (2011).
http://sellcarsnew.blogspot.com/2011/07/modern-eraof-automobile.html
InternationalJournalofComputerApplications.
A. T. Al-Taani, “An expert system for car failure diagnosis”, World Academy of Science,
Ricardo Nurzal, (2015) “A Decision Support System for Car Fault Diagnosis Using Expert
RAJAT, G. (2015) Developing a Simulink model for an engine cooling system and its
<?phprequire_once('Connections/CFES3.php'); ?>
<?php
$e=$_GET['cat'];
$ee=$e;
$c=$_GET['catt'];
if (!function_exists("GetSQLValueString")) {
functionGetSQLValueString($theValue, $theType, $theDefinedValue = "",
$theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_CFES3, $CFES3);
$query_Recordset1 = "SELECT * FROM symptoms_table";
$Recordset1 = mysql_query($query_Recordset1, $CFES3) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
mysql_select_db($database_CFES3, $CFES3);
38
mysql_select_db($database_CFES3, $CFES3);
$output = '';
//collect
if(isset($_POST['search'])){
$searchq= $_POST['search'];
}
}
}
echo $searchq;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>CAR FAULT EXPERT SYSTEM</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<scriptsrc="js/jquery.min.js"></script>
<script type="text/javascript">
function reload(){
var v1=document.getElementById('symptom1').value;
40
// document.write(v1);
self.location='index.php?cat=' + v1;
}
</script>
</head>
<body>
<div class="site-wrap">
<div class="site-mobile-menu">
<div class="site-mobile-menu-header">
<div class="site-mobile-menu-close mt-3">
<span class="icon-close2 js-menu-toggle"></span>
</div>
</div>
<div class="site-mobile-menu-body"></div>
</div><!-- .site-mobile-menu -->
<div class="container">
<div class="row align-items-center">
</select>
</div>
</div>
<div class="col-md-6 col-lg-3 mb-3 mb-lg-0">
<div class="select-wrap">
<span class="icon-keyboard_arrow_down arrow-down"></span>
</div>
</div>
</div>
</div>
</div>
<div class="tab-content bg-white p-4 rounded" id="pills-tabContent">
<?php print("$output1");?>
<?php print("$outputfaulty");?>
<?php print("$output");?>
<?php print("$outputtypee");?>
<?php print("$output2")?>
43
<?php print("$outputsymptom")?>
<?php print("$output3")?>
<?php print("$outputcause")?>
<?php print("$output4")?>
<?php print("$outputsolutions")?>
<?php print("$output5")?>
</div>
</div>
</div>
</div>
</div>
</div>
<footer>
</div>
</footer>
<scriptsrc="js/jquery-3.3.1.min.js"></script>
<scriptsrc="js/jquery-migrate-3.0.1.min.js"></script>
<scriptsrc="js/jquery-ui.js"></script>
<scriptsrc="js/popper.min.js"></script>
<scriptsrc="js/bootstrap.min.js"></script>
<scriptsrc="js/owl.carousel.min.js"></script>
<scriptsrc="js/jquery.stellar.min.js"></script>
<scriptsrc="js/jquery.countdown.min.js"></script>
<scriptsrc="js/jquery.magnific-popup.min.js"></script>
<scriptsrc="js/bootstrap-datepicker.min.js"></script>
<scriptsrc="js/aos.js"></script>
<script>
44
varplaceSearch, autocomplete;
varcomponentForm = {
street_number: 'short_name',
route: 'long_name',
locality: 'long_name',
administrative_area_level_1: 'short_name',
country: 'long_name',
postal_code: 'short_name'
};
functioninitAutocomplete() {
// Create the autocomplete object, restricting the search to geographical
// location types.
autocomplete = new google.maps.places.Autocomplete(
/** @type {!HTMLInputElement} */(document.getElementById('autocomplete')),
{types: ['geocode']});
// When the user selects an address from the dropdown, populate the address
// fields in the form.
autocomplete.addListener('place_changed', fillInAddress);
}
functionfillInAddress() {
// Get the place details from the autocomplete object.
var place = autocomplete.getPlace();
functiongeolocate() {
45
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
vargeolocation = {
lat: position.coords.latitude,
lng: position.coords.longitude
};
var circle = new google.maps.Circle({
center: geolocation,
radius: position.coords.accuracy
});
autocomplete.setBounds(circle.getBounds());
});
}
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?
key=AIzaSyBVWaKrjvy3MaE7SQ74_uJiULgl1JY0H2s&libraries=places&callback=initAutoco
mplete"
async defer></script>
<scriptsrc="js/main.js"></script>
</body>
</html>
<?php
mysql_free_result($Recordset1);
mysql_free_result($Recordset2);
?>