POSTING DATA USING AJAX
1) Create home.php page and write the code as given below
Here in the above code you can see one new line just because till now we are posting data using GET method… but in this example we are interested to pass data USING POST METHOD…
xhttp.open("POST","update.inc.php", true);
xhttp.setRequestData('Content-type','application/x-www-form-urlencoded');
And to pass data using POST We MUST HAVE TO WRITE THE ABOVE LINE OF CODE…
xhttp.send(pass_parameters);
Also we need to pass our textbox value through parameter and using SEND METHOD…
Open update.inc.php file and write the below code…


No comments:
Post a Comment