- Easy Simple Tutorial How To Use Ajax Jquery With Php
this tutorial will show you how you can use jquery to get ajax from a server side script using simple html and php code , Last Updated: Sun Jun 14, 2020
Sun Jan 29, 2012
so with that in mind, i am going to show you a simple script which you can use to practice and see how it works.
im a PHP programmer so i will be performing the server side script using PHP.
i am using a Windows 7 Computer so i will be using notepad to create the files.
the first file we are going to create is the HTML file, you can call it jquery-simple-ajax.php or jquery-simple-ajax.html whatever you want. i am going to call it jquery-simple-ajax.php
so open a new notepad, copy and paste this code and save it as jquery-simple-ajax.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Simple JQuery Ajax Example by Webune.com</title>
// This functions starts the ajax to show the output from post.php
// COPYRIGHT: WWW.WEBUNE.COM
<a href="#" onclick="StartAjax('ResultsId');">Click Here to see content from post.php</a>
next we are going to create the server side file called post.php
open another notepad, copy and paste the following code and save it as post.php
# The followin code will be sent to the ResultsId div in the jquery-simple-ajax.php file
# COPYRIGHT: WWW.WEBUNE.COM
echo 'This is the Data Received:<br><PRE>';print_r($_REQUEST);echo '</PRE>';