Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 406 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
406
Dung lượng
7,7 MB
Nội dung
[...]... Troubleshooting 414 Index 417 xvii xviii PHP&MySQLEverydayApps For Dummies Introduction B ecause you’re looking at a book called PHP&MySQLEverydayApps For Dummies, I assume you want to build a Web application with the PHP scripting language and a MySQL backend database If you need to build a dynamic Web application for a specific purpose, you’re in the right place You will... either PHP 4 or PHP 5, with the exception of the MySQL function calls See the following section, PHP and MySQL together,” for further information on the MySQL function calls The object-oriented programs in this book run only with PHP 5 PHP and MySQL together PHP interacts with MySQL by using built-in functions Currently, PHP provides two sets of functions for use when accessing MySQL databases: the MySQL. .. the MySQL Improved extension The MySQL Improved extension was made available with PHP 5 for use with MySQL 4.1 When you install PHP, you activate either the MySQL or the MySQL Improved extension PHP 4 activates MySQL automatically during installation You don’t need to activate it yourself PHP 4 activates the MySQL extension The MySQL Improved extension isn’t available with PHP 4 You can use the MySQL. .. Security Risks .24 Building Security into Your PHP Scripts 24 Don’t trust any information from an outside source 25 Storing information .30 xii PHP&MySQLEverydayApps For Dummies Using system calls .31 Handling errors 32 MySQL Security .33 Setting up accounts and passwords 33 Accessing MySQL from PHP scripts 37 Understanding SQL injection... 4.1 However, the functions used in PHP might or might not run correctly See the following section for information on PHP versions PHP Currently, PHP is maintaining two versions: PHP 4 and PHP 5 The current versions are PHP 4.3.11 and PHP 5.0.4 PHP 5 is a major change from PHP 4 Enhancing object-oriented programming features was an important goal in the development of PHP 5 The creation and use of objects... extension with MySQL 4.1; you just can’t use some of the new version 4.1 features PHP 5 doesn’t activate MySQL automatically You need to enable MySQL support yourself either by using the installation option — with -mysql or with-mysqli — on Linux/Mac or by uncommenting one of the following lines in php. ini: ;extension =php_ mysql. dll ;extension =php_ mysqli.dll In general, it’s best to use mysql with MySQL version... possible Consequently, you need to be aware of versions and keep informed about PHP and MySQL versions, changes, and problems Chapter 1: Building Your Application MySQL Currently, MySQL offers three versions: MySQL 4.0, MySQL 4.1, and MySQL 5.0 At this time, MySQL 5.0 is a developmental version, not recommended for production uses It’s fine for testing or experimenting, but if you have a Web site that... Designing the Forum database 311 Building the forum tables 314 Accessing the forum tables 315 Adding data to the database 316 Building the Forum Web Pages 317 Designing the Forum Web pages .317 Writing the code for the Forums page 321 Writing the code for the Threads page 324 Writing the code for the Messages page 328 Writing the code for the New... features of PHP for people who know PHP, but are unfamiliar with the concepts and terminology of object-oriented programming Appendix B describes the syntax of PHP object-oriented features for those who are familiar with object-oriented Introduction programming in another language Appendix C provides information on PHP functions used to interact with MySQL It provides tables for converting from mysql functions... object-oriented programming 5 6 PHP&MySQLEverydayApps For Dummies If you modify an application for use on your own Web site or build your own application by using the book applications as a pattern, you need to consider security issues Security is a major issue for Web applications Chapter 2 explains the security issues and describes how to write secure programs in PHP Part I Introducing Application . Janet Valade PHP & MySQL ® Everyday Apps FOR DUMmIES ‰ 01_575872 ffirs.qxd 5/27/05 6:16 PM Page iii 01_575872 ffirs.qxd 5/27/05 6:16 PM Page ii PHP & MySQL ® Everyday Apps FOR DUMmIES ‰ 01_575872. 6:16 PM Page ii by Janet Valade PHP & MySQL ® Everyday Apps FOR DUMmIES ‰ 01_575872 ffirs.qxd 5/27/05 6:16 PM Page iii PHP & MySQL ® Everyday Apps For Dummies ® Published by Wiley Publishing,. database 81 PHP & MySQL Everyday Apps For Dummies xii 02_575872 ftoc.qxd 5/27/05 6:35 PM Page xii Building the Login Web Page 82 Designing the login Web page 82 Writing the code for the login