i
PHP Variables
PHP Data Types
PHP Echo & Print
PHP Strings
PHP Numbers
PHP Constants
PHP Operators
PHP if...else...elseif Statements
Switch Statement
PHP Loops
PHP Arrays
Superglobals
PHP Coding Standards
PHP Form Handling
PHP Form Validation
PHP URLs Validation
PHP Form Required Validation
Complete Form Example
PHP File Functions Open/Read
PHP File Create/Write
PHP File Upload
PHP Cookies Handling
PHP Session Handling
PHP filter_var() Function
PHP Validation Filters
PHP Sanitization Filters
Using Filters
Filters Advanced
JSON
PHP Date and Time
MySQL Database
MySQL Connect
MySQL Commands-Creating a Table
MySQL Commands-Inserting The data
MySQL Commands-Prepared Statement
MySQL Commands-Selecting The Data
MySQL Commands-Where and Order By
MySQL Commands-Deleting And Updating The Data
PHP-OOP Introduction
PHP-Classes/Objects
PHP-Constructor/Destructor
PHP-Access Modifiers
PHP-Inheritance
PHP-Inheritance and Protected Access Modifier
PHP-Overriding Inherited Methods
PHP-Final keyword
PHP-Abstract Classes
PHP-Constants
PHP-Traits
PHP-Static Methods and Properties
Introduction to Functions
Defining A function
Returning Values From A Function
Dynamic Function Calls
Variable Scope
Understanding Arguments Or Parameters
Testing For A Function Existence
Returning Multiple Values From A Function
Making practical Use By Building Code Libraries For Code Re-usability
Using Include() And Require()
AJAX can also be used to create more user-friendly and interactive live searches on a webpage. Example, when you type something on Google, you get all the similar suggestions or the query you were going to type. So, instead of typing the whole sentence, you can easily click on the suggested inputs.
With AJAX live search, you will get the results as you type in the input field and will go on decreasing as you continue typing your sentence.
The search is started with the str.length function to check if the user is typing or not. Till user doesn’t type anything, no action is taken. But if the input field is not empty, then the function executes the below code.
An XMLHttpRequest object is created.
A function is created when the server response is ready.
The request is sent to the php file on the server.
The php code then searches for the matching words or sentences and returns the matching results. The XML file is loaded to a new XML DOM object, and a loop runs to find the matching results. The correct value is sent to the URL, and all matches are added to the variable and listed as suggestions. And, if no matches are found, then no suggestions is printed.
For AJAX live search, it is important to have quite long dataset so that user experience is more interactive and useful.
Don't miss out!