Posted inTechnology / Ajax / JavaScript / jQuery / Mysql / Mysqli / php / Programming

jQuery Ajax GET & POST REQUEST Methods PHP MySQLi

jQuery Ajax GET & POST REQUEST Methods PHP MySQLi

Today, We want to share with you jQuery Ajax GET & POST REQUEST Methods PHP MySQLi.
In this post we will show you jQuery – GET & POST REQUEST Methods with PHP, hear for Jquery, Ajax Form Submit with PHP,Mysql we will give you demo and example for implement.
In this post, we will learn about Ajax Add & Delete MySQLi records using jQuery & PHP with an example.

There are as a below HTTP Request: GET vs. POST

There are main Two types of Browsers user(Client) can Send An data information to The WebSite(SERVER).

The use of GET METHOD
The use of POST METHOD

The use of Specially Get Method Seprated by ? parameters.

Get Method Send Data restiction to send data client side to server side (1024 characters) Only.

This Fet method Featch all of this data $_GET or as a particuler varible fetch usinf GET Method ($_GET[‘varible_name’]).

The POST method (Send c to s)transfers ALL information via HTTP headers.(cros)

The POST Method never have a any type of Restriction and data information Send to Client Side to Server Side(website).

POST Method send Data Client Side to webserver send used to ASCII as well as binary data.
The POST Method Provides Fetch The All Of The Data Information($_POST) or As a Varible Fetch the data ($_POST[‘varible_name’]).

By using Stntax :

$_SERVER['REQUEST_METHOD']

Example : Detecting request type in PHP (GET, POST, PUT or DELETE)

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
     // request is using the POST method
}
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
     // Show The request is using the GET method
	 
}	
if ($_SERVER['REQUEST_METHOD'] === 'PUT') {
     // Show The request is using the PUT method
	 //   Example of Put method data send client to server 
}
if ($_SERVER['REQUEST_METHOD'] === 'DELETE') {
     // Show The request is using the DELETE method
	 //    
}

Two HTTP Request Methods: GET and POST

The Example Of GET Method


   
   

Prohect Name: Technology Type:

The Example Of POST Method



   
   

Prohect Name: Technology Type Enter :
$.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "api/request_project.php", dataType: "json", //Send data using data: "{'projectStartDate' : '" + new Date(projectstartdate) + "','projectEndDate' : '" + new Date(.projectenddate) + "','projectNo' : '" + $data['projectNo'] + "','StatusCode' : '" + StatusCode + "'}", success: function (data) { var msg = $data['Name'] + "added Successfully."; window.setTimeout(function () { window.location.href = "projectAssign.php"; }, 0000); }, error: function (result) { alert("function in Generated err display..."); } });

I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

Leave a Reply

Your email address will not be published. Required fields are marked *

We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype