Dynamically Typed: XMLHttpRequest and PHP Atom
126013
On Dynamically Typed today, there's a new posting concerning the PHP Atom Server.
72240
In a previous post, Raphael Stolt showed how to create a simple application that handled the transmission of a JSON-formatted message from the Zend Framework's Zend_Service component (translating XML to JSON in the process). In this new post today he shows the other half of the equation - how to handle the JSON messages on the receiving end.   In this post I'd like to show how to unpack the JSON response and render a visual representation by utilizing the Template class of the Prototype JavaScript library.   The code is all Javascript but it's a good example of how to break down the request and output a simple list format of the contents to the page (record "shelf" and record information).
435796
The Zend Developer Zone has posted part two in their look at developing an Ajax and PHP chat client. They build on part one and bring some new guests to the party - Prototype and Scriptaculous.   For this chat application we'll be using two popular javascript libraries: Prototype and Scriptaculous. Prototype is a Javascript framework that aims to ease development of dynamic web applications. Using Scriptaculous, complex effects like sliders, drag and drop and similar features can be implemented quite easily without much effort.   They assume that you can get Prototype and Scriptaculous set up yourself and move quickly on to the HTML for the chat client interface. Some CSS is included to make things a bit more attractive, and they show how to change the IndexController and include the needed Javascript files to make the interface work. Keep an eye out for the next tutorial where it's back to the server side of things...
466256
Ligaya Turmelle has relayed some great news in her latest blog entry, something that the web's been needing for a long time - a new group from the W3C created specifically for enhancing the HTML standard.   Now I have to admit to being curious about what is going on - after all anything new dealing with the web affects me as PHP coder. Since the W3C is supposedly interested in input from the Web community and content developers, I decided to see who from PHP would be there. Granted it is very early for the formation of the group so it didn't really surprise me to see no one from PHP that I know or heard about in there, but I wonder if anyone from the PHP Group will become a "invited expert" somewhere down the road.   The group is looking for members to help define this next generation of markup on the web. Check out their page for some of the qualifications needed to participate and for some of the upcoming events.W3C Launches New HTML Working Group
218661
The DeveloperTutorials website has a new tutorial posted today that covers their method for combining Ajax and PHP to create a custom form handler.   For this project, I needed a form to send an email to the client once it's been validated and checked to be ok. [...] I decided to spice things up a bit with a little AJAX and a few effects from Scriptaculous. So let's dive into exactly how I did it.   They create their form first - a standard user info type of thing - and set it up to use the WForms validation script in PHP. They include the Javascript the script needs to run the validation and to handle sending the form's contents back out via an email.
487989
PHPBuilder.com has posted part one of a new series looking at using AJAX functionality on your site (along with PHP_ to create a simple form handling script.   So you're interested in AJAX? AJAX is a powerful addition to JavaScript for browser-to-server intercommunication. We will demonstrate a simple script that sends a GET or POST request to a form handling script on a server, then the server script will return a response to the browser XMLHttpRequest JavaScript object.   They start with a definition of what AJAX is and how it can be used before getting into the examples - the first of a simple text field in a form that sends the contents back to the server and the second to fetch dynamic image information from the server.
722199
Balazs Kovacs has posted an introduction to using forms in a PHP script, a vital part of any online application.   If you have ever made any  HTML page or started dynamic web programming then you probably have already meet with forms. Forms are special components which allows your site visitors to supply various information on the HTML page.   His example goes all the way from showing an example of an HTML form out to handling the data submitted to it and validating that to ensure correctness.
712524
Alright power PHP users out there, Adam Trachtenburg has a little quiz for you to see how much you know about working with the DOM in PHP.   Here's a question based on a recent PHP bug report which shows why DOM is fun. [...] But how do you retrieve it (the namespace URI of the root node) using DOMElement::GetAttributeNS()? What are the two magical input parameters to coax that value out?   The code is simple, but it's an interesting problem - anyone have any answers?
445025
Popular posts from PHPDeveloper.org for the past week:Stijn Leenknegt's Blog: [PHP6] function-return-array idea!GeesNotNerds Blog: Free PHP + Ajax chat appStefan Mischook's Blog: Object Oriented PHP Tutorial Updated - Steps 18 - 22Dave Dash's Blog: SymfonyCampWebDigity.com: PHP geotargeting techniquesEtienne Kneuss' Blog: Late Static Bindings ExplainedDevShed: Handling Static Data with PHP 5PHP-Learn-It.com: Cooking Cookies with PHPMichael Kimsal's Blog: PHP PredictionJob Posting: Steinman Recruiting Seeks Senior Developer (Littleton, CO)
73354
DevShed has posted part one of a new pair of articles that show how to use inheritance in your PHP applications.   In the two articles in this series I'm going to show you how to build a sample object-based web site from its bare bones structure, by using the encapsulated logic of some parent and child PHP 5 classes. In this way I'll demonstrate how inheritance can be used to tackle a concrete project, such as constructing dynamic web pages.   In part one, they build the foundation of their sample application - a web page builder - by defining the WebPage class and abstract methods for it like buildHeader, buildStyles and buildBody. Inheriting from this, they build a HomeWebPage class that defines the methods and values to create a simple page. They take it even a step further and build an AboutUsWebPage to show another implementation.
211610
In one of his recent blog entries, Brian Moon takes a look at what he considers the "proper use" of the PHP superglobal $_REQUEST (as brought on by a thread on the PHP internals mailing list.   I have seen more than one person make the following logic mistake: I may get data via GET, I may get data via POST - Ah, I should use $_REQUEST as it will catch both.   Brian points out the error - cookies aren't in $_REQUEST so improper handling of those values could lead to cookie data overwriting GET/POST data from $_REQUEST. Several of the comments on the post also warn against improper handling of the values, noting that doing so could lead to holes open for attacks (like session fixation).
179659
From the DevChix website, there's this new post that helps introduce developers (both in PHP and Rails environments) to hos to use the Yahoo! UI connection manager in their applications.   This post is geared towards folks who haven't done the "A" part of "AJAX" before (And I mean the first "A", as in "Asychronous"); are new to Yahoo's implementation of the XMLHttpRequest object (The Yahoo! Connection Manager) and would like added information on how that works; or both.   Sarah starts off slow with an example of making a connection to a backend PHP script as called by a HTML form. The simple example is fleshed out with a database backend (via PEAR::DB) and the Javascript to handle the response and the errors that might arise. Finally, a request can be made and the result eval-ed to give the client a nice, simple Javascript object to work with.
662626
O'Reilly's ONLamp.com website has posted a new tutorial that merges PHP with another powerful web technology - Flex.   With all the hype (and money) surrounding buzzword terms like Web 2.0 and Rich Internet Applications (RIA), it's easy to wonder, "How can I integrate that into my PHP application?" Certainly, Asynchronous JavaScript and XML (Ajax) technologies that use JavaScript code are a good option. But you should also have a look at the Adobe Flex framework. With Flex, you can quickly build functional, attractive user interfaces in Adobe Flash that communicate to your PHP web application through XML.   They go through the usual of showing what Flex is and how it flows in a web application. From there, they move into the tutorial portion - installing the Flex Builder software, creating a new project, testing using Flex Builder and the construction of a sample application (store/access a list of subscribers).
239279
According to this post on the Zend Developer Zone (and the original post by Greb Murray), the jMaki project has announced that they will support PHP as a part of their Ajax framework.   am proud to announce that jMaki now has a server runtime that fully supports jMaki for PHP 5. This is in addition to JSP, JSF, and Phobos.   The jMaki project is an Ajax framework that gives the developer some lightweight, reusable widgets either they can make or that can be inherited from something like the Dojo toolkit, Yahoo UI, Scriptaculous, and many other libraries. This new PHP integration makes it as easy as a simple PHP call to integrate it into your application.    Check out Greg's blog entry for more details and an example of how to use this new functionality.
238493
What makes Ajax possible is the communication layer with the server. The most complete option is the JavaScript XMLHttpRequest object. If XMLHttpRequest is not suitable, hidden IFrames and cookies can also be used. Both will be examined here. By Joshua Eichorn. 1009
747119
On PHPied.com, Stoyan Stefanov shows how, via a simple bit of code (using some SimpleXML) he replaced the javascript widgets he was previously using for weather information.   So it was time for a change, since those buttons were generated by some javascripts, hosted by theweathernetwork, which is kind of a web 1.0 way of sharing content. In the days of APIs and stuff, this is a shame.   He dropped theweathernetwork.com's information and went for something a little more API-friendly - the weather feeds that Yahoo! offers. Once he figured out the right URL parameter to pass for the cities, it was just a matter of whipping up a 30 line script (using SimpleXML) to grab the weather information for the city and echo out the data.
583679
On PHPied.com, there's a new tutorial that combines the power of Ajax with the flexibility of PHP to create a more Ajax-centric version of an Model/View/Controller structure.    This is sort of a framework thing to create AJAX applications, based on the MVC design pattern. Yep, I have a lot of buzzwords here, I admit, but this shouldn't be taken too seriously. I was doing a bunch of small projects lately and I found myself using something like this little framework, without even thinking about it.    Then I thought about it and I found that the scripts and the organization of them may resamble MVC a bit. So how does MVC fit when you mix things like thin and fatter client, HTML, JavaScript, XMLHttpRequest, PHP and CSS?    He compares the "usual flow" of Ajax applications verus how an MVC-like app would work and shows a simple version of one in action. It uses PHP for the Model, Javascript/PHP for the Controller logic, and strictly HTML/CSS/Javascript for the View to output to the user. He incorporates some of the Yahoo! UI functionality to help capture events and make the backend Ajax connection. His sample sends off an Ajax request to the PHP backend when the button is pressed and takes in the message (HTML) and pushed it back out into the current page.   The demo is here and you can download the source as well.