The IBM developerWorks website has a new tutorial for those looking to get into the powerful combination of Ajax and PHP - an introduction to creating Ajax-based websites with PHP.
Learn the process of writing Asynchronous JavaScript + XML (Ajax) applications using native JavaScript code and PHP. This article introduces a few different frameworks and application program interfaces (APIs) that reduce the amount of code you need to write to achieve a complete Ajax-based Web application.
They (briefly) explain what Ajax is and the benefits of it before jumping right in to a sample page. They go for the "manual first" approach so developers know to make basic connections with the XMLHttpRequest object and handle the responses. They do mention some of the libraries offered that help with the connections too (like jQuery, Prototype and Dojo).
The Bakery has a grouping of six new articles/tutorials/components posted covering things from SOAP to loading models on the fly to some of the latest CakePHP releases:
A new introductory tutorial over on DevArticles looks to help you get acquainted with Ajax through its use in both PHP and JSP:
This is a two-part article. In these two parts I'll try to describe what AJAX is, and how to use AJAX in PHP and JSP. Later we will use some advanced JSP tag libraries to make cool AJAX-based web applications.
This first part looks at the basics of the connection - the XMLHttpRequest object and a simple example putting it to use grabbing the latest date from a background PHP or JSP script (complete with screenshots of the end result).
PHPBuilder.com has a new tutorial posted today with a look at the easy creation of dynamic XML with the data from a database.
In this article I will show how to generate dynamic XML documents with Object-Oriented PHP. Before I get started, let's get right to the heart of this functionality. Although the code may look fancy, being packaged up inside objects and inheritance, the key elements of this functionality rest in the the mysql_list_fields() and mysql_num_fields() functions.
The XML is built manually with the tags assigned to a string as they are built. The information is from a simple query to select all from a user-defined table and is output with a UTF-8 character encoding. They also include a Javascript (download) that helps in making an XMLHttpRequest connection to fetch the XML you've created and pull it in.
PHPBuilder.com has posted part two of their look at combining Ajax and PHP. They take things a step further than last time and look at the actual communication between the script and the server.
AJAX and PHP 5 both have powerful features for processing and using an XML document. XML is a method of formatting data often for communication purposes between different computer systems. In this article, we will show you how to access an XML document with AJAX!
They create a script that can load the XML information from a file and echo it back out to the waiting client script. They also include the other half - the client-side javascript that grabs the XML information, parses it, and pushed it into a javascript object for easy access.
The Zend Developer Zone has posted a new book review of one of SitePoint's web development related titles - "Building Your Own AJAX Web Applications".
I'm way behind on my book reviews. I've got a stack that's still knee-high and I know that there are more on the way. So let's pop one off the stack and take a peek into it shall we? This time it's "Building Your Own AJAX Web Applications" by Matthew Eernisse and published by SitePoint.
New today on his blog, Jacob Santos has posted some of the quirks that he's found in his dealings with PHP and the XMLHttpRequest object for Ajax comunications.
I didn't find the AJAX frameworks much use while I was working on my current project. I'm sure they are well thought out and designed, but after going through two or three, I was more lost than when I started. I decided then that I should learn how this whole AJAX thing works from the ground up. Turns out XMLHttpRequest isn't all that difficult, once you get past a few JavaScript cross browser hiccups.
He starts off talking about the PHP backend including the three methods you can display the information (return the content) back to the calling script. From there, it's on to the (two) quirks:
Don't Create an Instance of the Same Object For multiple Tasks
Always Call XMLHttpRequest Object First
Both quirks come with their own code an an explaination as to what the real issue is and how to work around it in your code. All of the changes he mentions, though, are on the client-side, leaving the PHP untouched.
The Daily WTF post for today bears mentioning if for nothing less than to show how to not do things. It has an interesting twist on the whole Ajax craze that's going on in the web today, and takes it to a really scary, pointless level.
The introduction of the XMLHttpRequest component (*) opened the doorway for a new breed of "fancy schmancy" web applications like Flickr, GMail, etc. This, in turn, spawned an entire sub-industry and a new series of buzzwords seemingly based on the names of household cleaning chemicals. It even incremented the current version of the Internet to 2.0.
That said, it should come as no surprise that this Borax-technology has also empowered "certain programmers" to create new perversions in information technology never imagined before. Gustavo Carvalho discovered what happens when XMLHttpRequest and the Eval() function in PHP are combined. I'll leave it to your immagination as to what the server-side looks like ...
You should definitely check out the code on this one - using evil() is bad enough, but passing code back to the PHP server like that is just wrong (and a huge security hole).
On AjaxDeveloper.org today, there's this new post with a pointer to an Evolt.org article released today about the creation of a login form with Ajax (and some help from PHP).
I started a project on the weekend that I wasn't sure was possible: creating a fully secure "ajax"-powered login system, ideal for blogs, forums, and other similar sites. I had a barebones secure case working within a few hours, and a few more hours gave the final result that I will share today.
They talk about how it's all structured, how the Ajax and PHP work together to make it happen, and what the end result looks like. They also link to a demo of the scripts where you can also download the pieces to get your own login working...
From our sister site, AjaxDeveloper.org today, there's this new post with an article from PHPit.net about using Ajax and PHP without the use of that pesky XMLHttpRequest object.
Ajax is one of the biggest 'discoveries' in the past year, and it has become a real buzzword, just like Web 2.0. Admittedly, Ajax can be used for a lot of things, and it really does speed up web applications.
But there is one problem with most of the current implementations of Ajax: it has one dependency, and that is the XmlHttpRequest object. [...] In this tutorial, I will show you how to use Ajax without even having to use the XmlHttpRequest object.
He starts off with a pretty basic introduction and shows you how to get the data into the current page (through the use of some PHP outputting Javascript). Then, with the help of pseudo-ajax functionality, it can poll this data to present dynamic information to the user of the site...