nextwebgen.com

The Next Generation Web Now

Build an RSS Feed Reader using Ajax and PHP

Filed under: Web 2.0 News, Front Page, Programming, Ajax, PHP — Chris Cornutt at 9:56 am on Wednesday, August 2, 2006

ScratchProjects.com has posted both Part one and Part two in a new tutorial series, this time with a focus on creating a RSS feed reader by combining PHP and Ajax.

In Part one they lay the foundation, explaining how the tutorial will work, what the parts are, and what the parts do. Then, it’s on to the code, showing first how to fetch and parse the remote feeds and create the DIV the results will be dropped into.

Part two takes the next steps and creates the form to add a feed to be parsed, the functionality to insert it and its information into the database, and to grab the list of feeds from the database and read in the contents.

It’s a pretty basic tutorial, but great for those just starting out with this handy, powerful functionality. It requires a bit of knowledge about PHP, but most of the code needed is spelled out for you. Plus, you can download the code as well.

PHPClasses.org Ajax Upgrade

Filed under: Web 2.0 News, Front Page, Usability, PHP — Michael Mahemoff at 8:54 pm on Tuesday, August 1, 2006

PHPClasses.org, a useful tool for locating PHP classes, has upgraded its search. There are a couple of Ajax goodies. Search results appear as a set of tabs - Packages, Reviews, Forum, etc, and the results for each tab are obtained via remote calls. Likewise for result pagination. There’s also a Suggestion/Auto-Completion feature in the search bar - a site like this is probably a good place for Suggestions, to help explore all the library code out there without knowing precise terms to search for.

The idea is to provide a better organization of the search results. It
is an alternative to the traditional search result pages that present
pages from all site sections in mixed in a single listing.

AJAX is used to retrieve the results from different sections when the
users click on the respective section tab.

The search form also provides auto-completion support. It uses AJAX to
query the site server database and retrieve the top ten most searched
keywords that begin with the first letters typed by the user.

The site search also uses an animation Javascript class to add a nice
touch of style using fade effects to the AJAX based page updates of the
search results and progress feedback messages.

The PHP and Javascript components used in the site to implement these
AJAX and DHTML features are available as Open Source as mentioned in
this PHPClasses site blog post.

Read more about the PHPClasses.org upgrade in Manuel Lemos’s announcement.

Creating an Ajax Login Page with Dojo/Zend Framework

Filed under: Web 2.0 News, Front Page, Programming, PHP, Dojo — Chris Cornutt at 8:14 am on Monday, July 31, 2006

Alexander Netkachev shows, in this new post on his site, how to create an Ajax-based login page with the help of the Dojo library and a new offering from Zend - the Zend Framework. The Zend Framework is a MVC-based framework written in PHP.

A few days ago I understood the right usage of the framework. Frankly speaking, it does not help with creating Web forms—it has no high-level complex components like TDataGrid in PRADO or even Repeater in ASP.NET. And what I understood is that it is not Zend Framework’s business how developers are creating their forms and here is a reason for this: modern pages are created with a lot of JavaScript and, I believe, are created with client-side components, not server-side.

He set this mission before himself - to create a lightweight Ajax form combining Dojo and the Zend Framework in the easiest way possible.

He assumes you already have both libraries installed (both relatively simple to get working) and gets straight to the code. First off is the creation of the view for the login form itself, the place where the Dojo toolkit is included and the Javascript functionality lives - as well as the simple login form. Next up is the controller for the PHP side, with three actions - a default action, one to perform the login, and the other to show a success message. Finally, there’s the Dojo javascript to make the request to the backend and the PHP script to validate if the username and password are correct.

Mike Potter Builds a Flash-y Ajax Site

Filed under: Web 2.0 News, Front Page, Ajax, PHP, Flash — Chris Cornutt at 3:19 pm on Tuesday, July 25, 2006

On his blog today, Mike Potter shares an application and a tutorial that he’s worked up a simple Ajax-based site integrating Ajax, JSON, PHP, and Flex.

With 90% of this being done with open source software (the only piece that is not open source, but is free (in terms of cost), is the Flex SDK), I’ve created a site that tries to mimics the experience of Google Finance, a great site that combines Ajax, and Flash together to provide a great user experience.

His posted the full tutorial explaining how it all works in PDF format off his blog, and has also created a zipped up version of all of the source code behind it. He also includes, in the post, some of the helpful hints he learned while working with the Spry Ajax framework:

  • Easier to modify the HTML output by Flex than reference the object in your own HTML
  • It’s easier not to mix things with the Flex/Ajax bridge, just use Flex Builder
  • Write functions that closely couple your Flex application to your HTML page
  • The ActionScript 3 JSON library doesn’t like new lines or carriage returns in the JSON data

XMLHttpRequest Quirks and PHP

Filed under: Web 2.0 News, Front Page, PHP, XmlHttpRequest — Chris Cornutt at 9:34 am on Monday, July 24, 2006

On his blog, Jacob Santos has written up two simple “gotchas” that he’s come across in his PHP/XMLHttpRequest adventures and wanted to share with other developers forging their way through the same experience.

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 talks briefly about his PHP backend and the methods that are available to return data in (XML/HTML/JSON) before talking about the issues he found:

  • Don’t Create an Instance of the Same Object For multiple Tasks
  • Always Call XMLHttpRequest Object First

For both, he gives a bit of code to explain the issue and to illustrate a workaround method, including the full code at the end of the post.

AJAX pagination made simple (with Symfony)

Filed under: Web 2.0 News, Front Page, Programming, PHP — Chris Cornutt at 8:46 am on Monday, July 17, 2006

Users of the PHP framework symfony are no strangers to easy-to-use functionality, and in this new post on the symfony blog, they share yet another - an Ajax pagination method.

Paginated lists in web pages imply specific controls to navigate across pages (link to previous and next page, link to a specific page, etc.). And lists are paginated because they are often too big to load. But when AJAX comes in, this last constraint disappears, and the specific controls can easily be replaced by a more intuitive tool: The browser’s scroll bar.

They include both an image/demo with an example of how the functionality works as well as (of course) the PHP code to make it all happen.

Integration of Spry and PHP/MySQL

Filed under: Web 2.0 News, Front Page, Programming, Framework, PHP — Chris Cornutt at 7:51 am on Thursday, July 13, 2006

Mike Kornienko writes in this new blog entry about his experiences (complete with code) integrating the Spry Ajax framework into a simple PHP/MySQL application he develops:

Adobe have recently released its Spry Ajax framework for public beta-test by developers and I’ve been playing with this baby for a while. And here’s some kind of report of what I have learned.

He gives several examples of the integration in his post, including the PHP to make some basic XML for Spry to use. His base-level Spry example grabs this data and just echoes it back out to the page via an HTML form. Before finishing it off with the full HTML/Javascript code, though, he shows how to sort by a specific column in the data (in this case, the ID column).

MODx CMS - An Ajax/PHP Content System

Filed under: Web 2.0 News, Front Page, PHP, Utility — Chris Cornutt at 8:24 am on Monday, July 10, 2006

There’s a new offering in the PHP/Ajax content management system world and it definitely looks like it has potential - MODx CMS.

MODx is an open source PHP Application Framework that helps you take control of your online content. It empowers developers and advanced users to give as much control as desired to whomever they desire for day-to-day website content maintenance chores.

Sounds a little vauge, right? Well, head over to the demo they offer, log in, and give it a shot. It’s not the most seamless integration, but it’s definitely a step above several of the “click three times to edit a post” offerings out there. Content changes are made in a rich-text editor and simple updates are possible from the pages themselves. The real power in this software, though, is in its Admin interface. There are options galore and a tree-style layout to help you manage not only the pages making up the site, but other content as well. Of course, it’s fully Ajax-enhanced as well, making it easiler to navigate and use.