tppAJAX

Get It Now Only $50!
License Agreement


Now supports JSON for fast communication!

tppAJAX is a lightweight, yet feature-rich PHP and Ajax toolkit that is compatible with PHP versions 4 and 5 (PHP 5.2 required for JSON).

No need to learn new server side techniques - tppAJAX sends information to your PHP scripts the way you're already used to: using $_GET and $_POST!

And sending a response back to your web page is as simple as using a few tppAJAX PHP functions - full PHP source is provided! The client-side API allows you to send simple requests or entire HTML forms to the server invisibly, behind the scenes, without having to refresh the entire page. This is the "magic" of Ajax. This request is sent and the results are received and processed automatically. Multiple connections can be communicating at any one time - tppAJAX utilizes connection pooling.

The server-side is a light-weight PHP solution that allows you to specify three different types of data to send back in response to a request.
  1. HTML content to be placed into containers specified by ID's in the HTML tags
  2. Properties to set on the document object
  3. Javascript Code to execute
This information is then used to automatically update pieces of the page, modify the document object and execute arbitrary Javascript code.
Get It Now Only $50!
License Agreement

tppAJAX v1.5 - 12/8/2007

Installation

To install tppAJAX:

  1. Extract the files in the zip file you will receive to a folder on your computer.

  2. FTP the Javascript files (located in a folder named js) to a sub folder named js inside the root website folder (usually the public_html or www folder) on your site.
    I typically use /js/ to make it easy to load the files from any page on the site.

  3. Put tppAJAX.php in the root website folder.

On the pages you want to provide tppAJAX functionality, you will need to put the following html tag:

<script type="text/javascript" src="/js/ajax.js"></script>

On the pages you want to provide tppAJAX functionality with Scriptaculous enhancements, you will also need to add the following html tags:

<script type="text/javascript" src="/js/prototype.js"></script>
<script type="text/javascript" src="/js/scriptaculous.js"></script>

If you will be using JSON (PHP Extension required - this is available by default in PHP version 5.2 and greater) you should NOT call tppAJAXStartResponse()!
At the top of the file that generates the output for tppAJAX, before any other codes including html, place the following code block

<?PHP

require_once( $_SERVER['DOCUMENT_ROOT'] . '/tppAJAX.php' );
tppAJAXStartResponse();

?>

It is absolutely critical that there are no spaces or lines before the <?PHP.

Now, using the documentation page as a reference guide, create up to three arrays containing the information you need to pass back to the Ajax script on the web page.

Then use a call to tppAJAXJSON or tppAJAXGenerate to do the final output on the ajax handling script. After the call to tppAJAXJSON or tppAJAXGenerate, your script must terminate without any additional output.

For web site hosting I recommend - www.bluehost.com