Beginning Ajax with PHP

11 comments | Posted: 8 January 07 in Books, by Nathan Smith

Ajax with PHP I received this book some time ago, but am just now getting around to writing a review because life has been quite hectic lately. That being said, this is a solid book for those looking to get their feet wet with Ajax concepts. Beginning Ajax with PHP: From Novice to Professional was penned by Lee Babin of the recently formed He brings a wealth of PHP knowledge to the table and effectively shows how to use it alongside JavaScript.

He starts out by explaining some of the concepts behind Ajax, and how it differs from web programming in a controlled environment. He gives real-life examples of how to use asynchronous scripting, such as an image uploader / photo gallery. He also gives examples of how to use Ajax for form submission.

He shows how to use the Google Maps API to create a spatially enabled web application – in this case, one that will locate nearby video game outlets. He also explains how to make use of PEARPHP Extension and Application Repository, using proven code to speed up Ajax development.

He also covers how to make use of various web services, and touches on potential pitfalls for security when using Ajax. I liked the way he referred to Ajax as an increased surface area of attack. While not necessarily hazardous to your site or data, it does afford would-be malicious hackers more opportunity. Lee shows how to defend against this and secure your code.

Lastly, he finishes up with an overview of DOM Scripting methods. To me, this seems like something that would have been better suited to the beginning of the book, but I suppose he positioned it as such to delve right into the guts of Ajax, and explain the theory behind it later. I did appreciate this tangible approach.

My one qualm with this book is the client-side code in the examples. There is a mix of document types throughout: HTML 4.01 / XHTML 1.0 Transitional / XHTML 1.0 Strict. I would like to have seen more attention placed on best practices for unobtrusive JavaScript and CSS layout, instead of inline event handlers and tables. That being said, it does effectively explain concepts behind Ajax and gives understandable PHP examples. It is well worth the read.

Discuss This Topic

  1. 1 Lance Fisher

    Hmm, looks interesting. Do you have any recommendations for starting out with PHP? I’ve been developing with ASP.NET for some time now, and I am pretty comfortable with HTML, CSS, and some JavaScript, but I’d like to start exploring PHP.

  2. 2 Nathan Smith

    Lance: I would recommend these three as excellent books on PHP:

    > Beginning PHP and MySQL 5: Novice to Professional – (by Apress)
    > PHP and MySQL Web Development – (by Developer’s Library)
    > PHP Cookbook – (by O’Reilly)

  3. 3 Deborah

    Another excellent book to consider: PHP Solutions: Dynamic Web Design Made Easy – (by Friends of Ed)

  4. 4 Lance Fisher

    Thanks, Nathan and Deborah! I think I’ll order Apress’ Beginning PHP and MySQL 5. Do you have any recommendations for a PHP IDE?

  5. 5 Nathan Smith

    Lance: I don’t use an IDE per-say. I just use MAMP and TextMate on the Mac or WAMP and Notepad++ on Windows. I hope that helps you get started! By the way, I just received PHP Solutions, and will be writing a review of it.

  6. 6 Josiah Platt

    This may not be the place for it, but I just stumbled on this blog and it’s one of the best I’ve seen in a long time.

    Expect to see me around.

  7. 7 Yannick

    Welcome Josiah. We’re happy that you stumbled upon Godbit. Make yourself at home and we hope it is a helpful community.

  8. 8 brian Ngana

    There is not enough good and simple books out there on AJAx, but seeing as its a fairly “new” concept… time will tell…I recomend this boook on my site and people find it to be a good resource…my 2 cents :)

  9. 9 Marcus

    Regarding PHP IDE. Commercial options are Dreamweaver and PHP IDE from Zend. Opensource (free) option is Eclipse IDE with the phpeclipse plugin. Dreamweaver and Eclipse have features/plugins to connect to a db and look at data. In Dreamweaver you would primarily use odbc drivers to connect to a database. This is important if using sqlserver as a db. In Eclipse jdbc drivers are only used. Install the quantum db plugin to access db data. I have no experience with the PHP IDE from Zend and cannot comment on using it.

  10. 10 Tanie linie lotnicze

    Beginning PHP and MySQL 5: Novice to Professional – is geat book.

  11. 11 Nate Klaiber

    Read half of this book while I was in a bookstore last week, and liked what it had to offer. While Ajax is not ‘new’ – its nice to see a brief book that can help you grasp using it with PHP as the server side language.

    Dreamweaver and Textmate are more code editors for a broad range of lanugages. The Zend IDE was excellent when I used it. Had excellent debugging and SQL tools as well. I would highly recommend it if you are looking for a good PHP IDE.

    I currently use Textmate as an editor (Don’t use the IDE anymore – due to needing other language bundles), use the MySQL toolset for administration, query, and building (mostly the query /admin tool), I also use Aqua Data Studio to SQL into our DB2 databases – its Java based and is one of the nicer SQL editors I have seen for Mac.


Comments closed after 2 weeks.