Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 68 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
68
Dung lượng
3,44 MB
Nội dung
[...]... weeks! http://www.phparch.com/cert September 2005 ● PHP Architect ● www.phparch.com 22 FEA TURE An Introduction to PDO by Ilia Alshanetsky A common complaint of the anti -PHP “expert” is the lack of a bundled, uniform database access component With the advent of an improved object model, in PHP 5.0, a few of PHP s core developers decided that the time has come to fill this hole with PHP Data Objects... download the latest stable PDO release, and then automatically compile it The next step involves loading the compiled PDO modules into PHP via php. ini: //*NIX users extension=pdo.so extension=pdo_sqlite.so // Win32 users extension =php_ pdo.so extension =php_ pdo_sqlite.so In PHP 5.0.x, there is no automatic handling of module dependencies; therefore, it is absolutely imperative that the PDO extension, itself,... print and online magazines on a variety of PHP topics, and is also the author of an upcoming book on PHP security Ilia can be reached at ilia@ilia.ws To Discuss this article: http://forums.phparch.com/249 33 NEXCESS.NET Internet Solutions 304 1/2 S State St Ann Arbor, MI 48104-2445 http://nexcess.net PHP / MySQL SPECIALISTS! Simple, Affordable, Reliable PHP / MySQL Web Hosting Solutions P O P U L... 25 MySQL Databases PHP5 / MySQL 4.1.X SITEWORX control panel 2000 MB Storage 50 GB Transfer 200 E-Mail Accounts 75 Subdomains 75 MySQL Databases PHP5 / MySQL 4.1.X SITEWORX control panel 16 95 /mo 900 MB Storage 30 GB Transfer Unlimited MySQL Databases Host 30 Domains PHP5 / MYSQL 4.1.X NODEWORX Reseller Access NEXRESELL 2 $ We'll install any PHP extension you need! Just ask :) PHP4 & MySQL 3.x/4.0.x... 11 TIPS & TRICKS Input Filtering, Part 3 Listing 4 (cont’d) Listing 3 1 2 3 4 5 6 7 8 9 10 < ?php require_once ‘PEAR .php ; require_once ‘Mail/RFC822 .php ; $parsed_email = Mail_RFC822::parseAddressList($_POST[‘email’); if (!PEAR::isError($parsed_email)) { $clean[‘email’] = $_POST[‘email’]; } ?> Listing 4 1 < ?php 2 define(‘STRING’, ‘/^[-A-Z0-9\.\’”_ ]*$/i’); 3 define(‘EMAIL’, ‘/^[^@\s]+@([-a-z0-9]+\.)+[az]{2,}$/i’);... come up with tweaks, additions and refinements to the initial code base that eventually evolves into a full database extension September 2005 G PHP Architect G www.phparch.com REQUIREMENTS PHP 5.0+ OS N/A Other Software PDO and an appropriate driver: http://pecl .php. net/pdo Code Directory n/a 23 FEATURE An Introduction to PDO bly require an entire book, and is far beyond the scope of this article The... database systems, themselves This has been somewhat of a pet peeve for the PHP core development community This is why we decided to address the issue—during LinuxTag 2003—with the advent of PHP Data Object (PDO) PDO was designed to use the latest PHP 5 object orientation support to provide a common API for all database systems with which PHP can communicate By creating a common database communication interface,... all of the initiallyplanned features It also includes support for all major databases with September 2005 ● PHP Architect ● www.phparch.com which PHP can communicate: p • MySQL 3 and 4 (pdo_mysql) p • PostgreSQL (pdo_pgsql) p • SQLite 2 and 3 (pdo_sqlite – in fact, PDO is the only way to connect PHP to SQLite 3) p • Oracle (pdo_oci) p • Firebird (pdo_firebird) p • MSSQL and FreeTSD (pdo_dblib) p • ODBC... free digital (PDF) subscription to php| architect Until next time, happy coding! About the Author ?> Ben Ramsey is a Technology Manager for Hands On Network in Atlanta, Georgia He is an author, Principal member of the PHP Security Consortium, and Zend Certified Engineer Ben lives just north of Atlanta with his wife Liz and dog Ashley You may contact him at ramsey @php. net or read his blog at http://benramsey.com/... Internet Explorer for exactly this reason: innovating too September 2005 ● PHP Architect ● www.phparch.com REQUIREMENTS PHP 4 CODE DIRECTORY abstraction much in the browser space would kill the desktop, which is their big cash cow Web applications are even more portable, on the server side, because most of the languages—be it PHP, Perl, or even some ASP, through emulators such as Chili ASP—can run on . Courses from php| architect Zend PHP Essentials Our introductory PHP course, Zend PHP Essentials, was developed for us and Zend Technologies by PHP expert Chris Shiflett, co-founder of the PHP Security. refresher course for PHP at all levels Every month 7 Sessions 19 Hours 3 Weeks YES Zend PHP Essentials $644.99 US ($838.99 CAD) Zend Professional PHP Development • Covers advanced PHP 4 and PHP 5 topics •. Rights Reserved TM September 2005 ● PHP Architect ● www.phparch.com 7 What’s NEW ? > PHP 5.1 RC 1 php. net announces the release of PHP 5.1 RC 1. " ;PHP 5.1 Release Candidate 1 is now available!