Book Image

AJAX and PHP: Building Responsive Web Applications

Book Image

AJAX and PHP: Building Responsive Web Applications

Overview of this book

Assuming a basic knowledge of PHP, XML, JavaScript and MySQL, this book will help you understand how the heart of AJAX beats and how the constituent technologies work together. After teaching the foundations, the book will walk you through numerous real-world case studies covering tasks you'll be likely to need for your own applications: Server-enabled form-validation page Online chat collaboration tool Customized type-ahead text entry solution Real-time charting using SVG Database-enabled, editable and customizable data grid RSS aggregator application A server-managed sortable list with drag&drop support using the script.aculo.us JavaScript toolkit The appendices guide you through installing your working environment, using powerful tools that enable debugging, improving, and profiling your code, working with XSLT and XPath. From the Author, Cristian Darie AJAX and PHP: Building Responsive Web Applications is mainly a book for beginners, but when designing its contents we tried to find the ideal blend of topics that would help both novice and experienced web developers make a big step forward. One customer was very kind to let us know, through a review, that we succeeded: "The theory behind all the technologies used is very clearly explained, without boring you with details about obvious things. Right from the first chapter you start learning by examples. The examples can be easily adapted to many web projects and they cover stuff that is both useful and fun." Here are a few examples of such "useful and fun" things that you can find in this book: details on using proxy scripts to work around the security measures in modern browsers client-side and server-side code that doesn't break when fed with special characters (such as <, ", etc) code that works efficiently with Internet Explorer 5, 6 and 7, Firefox, Opera, Safari, and others a very quick introduction to SVG, the new rebel kid of the web (and of the house) client-server communication based on message queues that guarantee that your messages aren't lost on the way, and arrive in the intended order at the destination server-side state management techniques that use query string parameters and database records to keep track of your client's activity simple yet effective error-handling structures that combine JavaScript code and PHP code to report when something bad happens on the client or on the server a live errata page that is updated as soon as anyone reports a suggestion or a correction a friendly AJAX tutorial and many case studies that teach you how to use JavaScript, PHP, MySQL and XML together in order to achieve wonderful results The book's authors and the publisher are listening to your feedback, and appreciate when you invest some time to let them know what you think. The first result of this collaboration is an updated version of the AJAX Chat case study that uses (and teaches) JSON instead of XML. Find this new chapter in the code download or on my website. Thanks for reading such a long message. Have fun!" Cristian Darie.
Table of Contents (17 chapters)
AJAX and PHP
Credits
About the Authors
About the Reviewers
Preface
Index

Installing phpMyAdmin


phpMyAdmin is a very popular MySQL administration tool written in PHP. It allows you to manage your MySQL databases using a simple-to-use web interface. The official web page is http://www.phpmyadmin.net. Follow these steps to install and configure this program:

  1. Start by downloading the latest version of phpMyAdmin from http://www.phpmyadmin.net/home_page/downloads.php. If you aren’t sure what file to download, the safest bet is to go with the zip archive.

  2. Unzip the archive somewhere on your disk. The archive contains a folder named with the complete phpMyAdmin version (for example, at the time of this writing, the folder for the beta version of phpMyAdmin is called phpMyAdmin-2.8.0-beta1).

  3. To make your life easier, rename this folder to simply phpMyAdmin.

  4. Move the phpMyAdmin folder to the htdocs folder of Apache 2 (by default C:\Program Files\Apache Group\Apache2\htdocs).

  5. To make sure your phpMyAdmin installation is accessible by Apache, load http://localhost/phpMyAdmin in your favorite web browser. If everything worked OK, you should get a message such as this:

    Figure A.4: phpMyAdmin Doesn’t Have Access to MySQL

  6. The error message is suggestive enough—you need to instruct phpMyAdmin how to access your MySQL server. Under the phpMyAdmin folder search for a file named config.inc.php. If you find this file, change its options as shown in the following code snippet. If you don’t find this file, create it with the following contents:

    <?php
    $cfg[‘PmaAbsoluteUri’] = “http://localhost/phpMyAdmin/”;
    $cfg[‘Servers’][1][‘host’] = “localhost”;
    $cfg[‘Servers’][1][‘auth_type’] = ‘config’; 
    $cfg[‘Servers’][1][‘user’] = “root”;
    $cfg[‘Servers’][1][‘password’] = “password”;
    ?>

    Note

    For more details on installing and using phpMyAdmin, see its documentation at http://www.phpmyadmin.net/home_page/docs.php. Packt Publishing has a separate book for those of you who want to learn more about phpMyAdmin—Mastering phpMyAdmin for Effective MySQL Management (ISBN: 1-904811-03-5). In case you’re not a native English speaker, it’s good to know that the book is also available in Czech, German, French, and Italian.