چه کسانی این کتاب را می‌خوانند

دانشجوعلاقه‌مند یادگیری
کتابخوان حرفه‌ایلذت مطالعه
نویسندهالهام‌گیری

The PHP Anthology: Object Oriented PHP Solution, Volume 1

Harry Fuecks; Kevin Yank; Georgina Laidlaw; Julian Carroll

قیمت نهایی

۴۹٬۰۰۰ تومان

نسخه اصلی و اورجینال

بلافاصله پس از خرید، فایل کتاب روی دستگاه شما آمادهٔ دانلود است.

تحویل فوری
پرداخت امن
ضمانت فایل
پشتیبانی

مشخصات کتاب

سال انتشار
۲۰۰۴
فرمت
PDF
زبان
انگلیسی
حجم فایل
۴٫۶ مگابایت
شابک
9780957921849، 9780957921856، 0957921845، 0957921853

دربارهٔ کتاب

What makes this book a little different from others on PHP is that it steps away from a tutorial style, and instead focuses on the achievement of practical goals with a minimum of effort. To that extent, you should be able to use many of the solutions provided here in a more or less “plug and play” manner, rather than having to read this book from cover to cover. Although it was originally conceived as a procedural programming language, in recent years PHP has proven increasingly successful as a language for the development of object oriented solutions. This was further compounded by the public opening in January 2003 of the PHP Application and Extension Repository (PEAR), which provides a growing collection of reusable and well maintained solutions for architectural problems (such as Web form generation and validation) regularly encountered by PHP developers around the world. The emphasis this book places on taking advantage of reusable components to build your PHP Web applications reflects another step away from the focus of many current PHP-related books. Although you won’t find extensive discussions of object oriented application design, reading The PHP Anthology, Volume I: Foundations and Volume II: Applications from cover to cover will, through a process of osmosis, help you take your PHP coding skills to the next level, setting you well on your way to constructing applications that can stand the test of time. The PHP Anthology, Volume I: Foundations 1 Summary of Contents 2 Cover Page Volume I: Foundations 4 Copyright 5 About The Author 6 About SitePoint 6 Dedication 8 Summary of Contents (linked) 2 Table of Contents (linked) 10 Preface 16 Who should read this book? 17 What’s covered in this book? 17 The Book’s Website 19 The Code Archive 19 Updates and Errata 20 The SitePoint Forums 20 The SitePoint Newsletters 20 Your Feedback 21 Acknowledgements 21 1. PHP Basics 22 Where do I get help? 23 Reading the Manual 23 Section I: Getting Started 24 Section II: Language Reference 24 Section III: Features 25 Section IV: Function Reference 25 Further Help 28 How do I fix an error that PHP finds in my script? 29 Syntax Errors 30 Semantic Errors 31 Environment Errors 31 Logic Errors 32 How do I include one PHP script in another? 33 Mutual Inclusion 33 Path Finding 36 How do I write portable PHP code? 37 Keep All Configuration Central 38 Use the Full Tags 39 register_globals off 39 Magic Quotes 40 Call-Time Pass-By-Reference Off 41 Write Reusable Code 41 Further Reading 43 2. Object Oriented PHP 44 What are the basics of object oriented PHP? 47 Classes and Objects 50 Understanding Scope 55 A Three Liner 56 How do references work in PHP? 60 What Are References? 61 Using a Reference 63 The Importance of References 64 Good and Bad Practices 67 Performance Issues 68 References and PHP 5 69 How do I take advantage of inheritance? 69 Overriding 70 Inheritance in Action 73 How do objects interact? 77 Aggregation 77 Composition 79 Spotting the Difference 80 Polymorphism 81 Further Reading 84 3. PHP and MySQL 86 How do I access a MySQL database? 87 A Basic Connection 88 Reusable Code 90 How do I fetch data from a table? 94 Fetching with Classes 96 How do I resolve errors in my SQL queries? 99 How do I add or modify data in my database? 100 Inserting a Row 101 Updating a Row 101 Another Class Action 102 How do I solve database errors caused by quotes/apostrophes? 104 The Great Escape 104 SQL Injection Attacks 107 How do I create flexible SQL statements? 108 How do I find out how many rows I’ve selected? 110 Counting Rows with PHP 110 Counting Rows with MySQL 111 Row Counting with Classes 113 Counting Affected Rows 114 After inserting a row, how do I find out its row number? 115 Class Insert ID 115 How do I search my table? 116 Select What You LIKE 116 FULLTEXT Searches 117 How do I back up my database? 119 How do I repair a corrupt table? 124 Do I really need to write SQL? 125 Further Reading 129 4. Files 132 How do I read a local file? 133 File Handles 136 Saving Memory 138 How do I modify a local file? 140 How do I get information about a local file? 142 How do I examine directories with PHP? 144 How do I display the PHP source code online? 146 How do I store configuration information in a file? 148 How do I access a file on a remote server? 150 How do I use FTP from PHP? 152 How do I manage file downloads with PHP? 156 File Distribution Strategy 157 How do I create compressed ZIP/TAR files with PHP? 159 Further Reading 162 5. Text Manipulation 164 How do I solve problems with text content in HTML documents? 164 Dynamic Link URLs 164 Form Fields and HTML Content 166 Line Breaks in HTML 167 Tag Stripping 168 It’s a Wrap 170 How do I make changes to the contents of a string? 170 Search and Replace 170 Demolitions 171 Short Back and Sides, Please 172 Formatting 173 How do I implement custom formatting code? 174 How do I implement a bad word filter? 178 How do I validate submitted data? 180 How do I filter out undesirable HTML code? 184 Further Reading 190 6. Dates and Times 192 How do I store dates in MySQL? 193 Unix Timestamps 194 MySQL Timestamps 195 Timestamps in Action 196 How do I solve common date problems? 201 Day of the Week 203 Week of the Year 204 Number of Days in a Month 204 Leap Years 206 Day of the Year 207 First Day in the Month 208 A Touch of Grammar 209 How do I build an online calendar? 211 A Roman Calendar 216 PHP Filofax 219 How do I deal with time zones? 223 How do I time a PHP script? 225 How do I schedule batch jobs with PHP? 226 Installing Pseudo-cron 226 Further Reading 228 7. Images 230 MIME Types 231 How do I create thumbnail images? 232 The Thumbnail Class 235 How do I add a watermark to an image? 244 How do I display charts and graphs with PHP? 246 Bar Graph 247 Pie Chart 249 How do I prevent “hot linking” of images? 251 Further Reading 255 8. Email 258 How do I simplify the generation of complex emails? 259 How do I add attachments to messages? 260 How do I send HTML email? 264 How do I mail a group of people? 266 How do I handle incoming mail with PHP? 268 A Solution Looking for a Problem? 272 Further Reading 272 9. Web Page Elements 274 How do I display data in a table? 276 PEAR Shaped Tables 276 How do I build a result pager? 280 Sliding Page Numbers 284 How do I handle HTML forms in PHP? 289 Guidelines for Dealing with Forms 290 Forms in Action with QuickForm 290 QuickForm Validation Rule Types 293 Sign Up Today 295 How do I upload files with PHP? 301 Using QuickForm for File Uploads 304 How do I build effective navigation with PHP and MySQL? 309 Hansel and Gretel 309 Lost in the Trees 310 A Recursive Table Structure 310 Feeding the Birds 314 Staying in Context 318 Drop Down Menu 320 Collapsing Tree Menu 322 Full Tree Menu 324 Handling Different Table Structures 326 Summary 327 How do I make “search engine friendly” URLs in PHP? 328 Doing Without the Query String 328 Hiding PHP Scripts with ForceType 331 Hiding PHP Scripts by Rewriting URLs 333 Designing URLs 335 Further Reading 338 10. Error Handling 340 How do I implement a custom error handler with PHP? 341 Error Levels 341 Generating Errors 345 Strategy for Generating Errors 346 Custom Error Handler 347 Triggered Errors vs. Conditional Execution 350 How do I log and report errors? 352 How do I display errors gracefully? 354 Further Reading 357 Appendix A: PHP Configuration 360 Configuration Mechanisms 360 Key Security and Portability Settings 362 Includes and Execution Settings 364 Error-Related Settings 366 Miscellaneous Settings 367 Appendix B: Hosting Provider Checklist 368 General Issues 368 PHP-Related Issues 370 Appendix C: Security Checklist 372 The Top Security Vulnerabilities 372 Appendix D: Working with PEAR 376 Installing PEAR 377 The PEAR Package Manager 380 Installing Packages Manually 381 Index (only Volume I links work) 384 Back cover 398

A compilation of best practice solutions to common Web Development problems in PHP, focusing on the achievement of practical goals by applying well-structured, object orientated software design principles.

Volume 1 covers the foundations of PHP including writing portable and reusable code, storing and extracting data from files, manipulating text, working with email and error handling.

In addition to being an excellent reference with over 60 customizable solutions, the book acts as an excellent primer for Object Orientated Programming. PHP 5 has now been released and has been given significant OOP features, which are a must-learn for PHP Developers.

All code in the book is backwards compatible with earlier versions of PHP.

A compilation of best practice solutions to common Web development problems. It focuses on the achievement of practical goals with minimal effort by applying well-structured object-oriented software design principles.

قیمت نهایی

۴۹٬۰۰۰ تومان