Ajax -programming in php, Summaries of Computer Programming

Programming in php unit 5 ajax notes

Typology: Summaries

2025/2026

Uploaded on 04/02/2026

vidhyalakshmi-3
vidhyalakshmi-3 🇮🇳

1 document

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
AJAX WITH PHP
Definition
AJAX (Asynchronous JavaScript and XML) is a technique used to send and
receive
data from the server without reloading the webpage.
It allows faster and smoother web applications.
FeaturesofAJAX
No page refresh needed
Faster data exchange
Improves user experience
Works in background.
WorkingofAJAXwithPHP
1.User sends request (button click / input)
2.JavaScript (AJAX) sends request to
server
3.PHP processes the request
4.PHP sends response
5.AJAX updates the webpage
Syntax (AJAX – JavaScript)
Var xhttp = new XMLHttpRequest();
Xhttp.onreadystatechange = function() {
If (this.readyState == 4 && this.status == 200) {
Document.getElementById(“demo”).innerHTML = this.responseText;
}
pf3
pf4

Partial preview of the text

Download Ajax -programming in php and more Summaries Computer Programming in PDF only on Docsity!

AJAX WITH PHP

Definition

  • AJAX (Asynchronous JavaScript and XML) is a technique used to send and receive data from the server without reloading the webpage.
  • It allows faster and smoother web applications. FeaturesofAJAX
  • No page refresh needed
  • Faster data exchange
  • Improves user experience
  • Works in background. WorkingofAJAXwithPHP 1.User sends request (button click / input) 2.JavaScript (AJAX) sends request to server 3.PHP processes the request 4.PHP sends response 5.AJAX updates the webpage Syntax (AJAX – JavaScript) Var xhttp = new XMLHttpRequest(); Xhttp.onreadystatechange = function() { If (this.readyState == 4 && this.status == 200) { Document.getElementById(“demo”).innerHTML = this.responseText; }

Xhttp.open(“GET”, “server.php”, true); Xhttp.send(); PHP File (server.php)

Simple Example

HTML + AJAX

Click Me

  • Fast response
  • Better UI/UX
  • Saves bandwidth
  • Asynchronous processing Disadvantages
  • Depends on JavaScript
  • Debugging is difficult
  • Security issues possible