SQL Web Database Applications Mysql Cookbook™ with PHP and Mysql PHP Cookbook™ Learning PHP 5 PHP Pocket Reference Upgrading to PHP 5

Total Page:16

File Type:pdf, Size:1020Kb

SQL Web Database Applications Mysql Cookbook™ with PHP and Mysql PHP Cookbook™ Learning PHP 5 PHP Pocket Reference Upgrading to PHP 5 Download from Wow! eBook <www.wowebook.com> Programming PHP Programming Other resources from O’Reilly Related titles Managing and Using MySQL Web Database Applications MySQL Cookbook™ with PHP and MySQL PHP Cookbook™ Learning PHP 5 PHP Pocket Reference Upgrading to PHP 5 oreilly.com oreilly.com is more than a complete catalog of O’Reilly books. You’ll also find links to news, events, articles, weblogs, sample chapters, and code examples. oreillynet.com is the essential portal for developers interested in open and emerging technologies, including new platforms, pro- gramming languages, and operating systems. Conferences O’Reilly brings diverse innovators together to nurture the ideas that spark revolutionary industries. We specialize in document- ing the latest tools and systems, translating the innovator’s knowledge into useful skills for those in the trenches. Visit con- ferences.oreilly.com for our upcoming events. Safari Bookshelf (safari.oreilly.com) is the premier online refer- ence library for programmers and IT professionals. Conduct searches across more than 1,000 books. Subscribers can zero in on answers to time-critical questions in a matter of seconds. Read the books on your Bookshelf from cover to cover or sim- ply flip to the page you need. Try it today for free. SECOND EDITION Programming PHP Rasmus Lerdorf, Kevin Tatroe, and Peter MacIntyre Beijing • Cambridge • Farnham • Köln • Paris • Sebastopol • Taipei • Tokyo Programming PHP, Second Edition by Rasmus Lerdorf, Kevin Tatroe, and Peter MacIntyre Copyright © 2006, 2002 O’Reilly Media, Inc. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (safari.oreilly.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or [email protected]. Editors: Tatiana Apandi and Allison Randal Cover Designer: Ellie Volckhausen Production Editor: Matt Hutchinson Interior Designer: David Futato Production Services: GEX, Inc. llustrators: Robert Romano, Jessamyn Read, and Lesley Borash Printing History: March 2002: First Edition. April 2006: Second Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Programming PHP, the image of a cuckoo, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. This book uses RepKover™, a durable and flexible lay-flat binding. ISBN-10: 0-596-00681-0 ISBN-13: 978-0-596-00681-5 [M] [10/07] Table of Contents Foreword . ix Preface . xi 1. Introduction to PHP . 1 What Does PHP Do? 1 A Brief History of PHP 2 Installing PHP 7 A Walk Through PHP 9 2. Language Basics . 18 Lexical Structure 18 Data Types 25 Variables 32 Expressions and Operators 36 Flow-Control Statements 49 Including Code 57 Embedding PHP in Web Pages 59 3. Functions . 63 Calling a Function 63 Defining a Function 64 Variable Scope 66 Function Parameters 68 Return Values 71 Variable Functions 72 Anonymous Functions 73 v 4. Strings . 74 Quoting String Constants 74 Printing Strings 78 Accessing Individual Characters 82 Cleaning Strings 82 Encoding and Escaping 83 Comparing Strings 89 Manipulating and Searching Strings 91 Regular Expressions 97 POSIX-Style Regular Expressions 101 Perl-Compatible Regular Expressions 106 5. Arrays . 119 Indexed Versus Associative Arrays 119 Identifying Elements of an Array 120 Storing Data in Arrays 120 Multidimensional Arrays 123 Extracting Multiple Values 123 Converting Between Arrays and Variables 127 Traversing Arrays 128 Sorting 133 Acting on Entire Arrays 138 Using Arrays 140 6. Objects . 143 Terminology 144 Creating an Object 144 Accessing Properties and Methods 145 Declaring a Class 146 Introspection 153 Serialization 159 7. Web Techniques . 164 HTTP Basics 164 Variables 165 Server Information 166 Processing Forms 168 Setting Response Headers 182 Maintaining State 185 SSL 195 vi | Table of Contents 8. Databases . 196 Using PHP to Access a Database 196 Relational Databases and SQL 198 PEAR DB Basics 199 Advanced Database Techniques 205 Sample Application 211 9. Graphics . 225 Embedding an Image in a Page 225 The GD Extension 226 Basic Graphics Concepts 227 Creating and Drawing Images 228 Images with Text 232 Dynamically Generated Buttons 236 Scaling Images 239 Color Handling 240 10. PDF . 246 PDF Extensions 246 Documents and Pages 246 Text 248 11. XML . 261 Lightning Guide to XML 261 Generating XML 263 Parsing XML 264 Parsing XML with DOM 277 Parsing XML with SimpleXML 277 Transforming XML with XSLT 278 Web Services 280 12. Security . 285 Filter Input 285 Escape Output 290 Cross-Site Scripting 293 Session Fixation 294 File Uploads 295 File Access 296 PHP Code 299 Table of Contents | vii Shell Commands 300 More Information 301 Security Recap 301 13. Application Techniques . 302 Code Libraries 302 Templating Systems 303 Handling Output 306 Error Handling 308 Performance Tuning 313 14. Extending PHP . 321 Architectural Overview 321 What You’ll Need 322 Building Your First Extensions 323 The config.m4 File 333 Memory Management 336 The pval/zval Data Type 338 Parameter Handling 342 Returning Values 345 References 349 Global Variables 350 Creating Variables 353 Extension INI Entries 354 Resources 356 Where to Go from Here 358 15. PHP on Windows . 359 Installing and Configuring PHP on Windows 359 Writing Portable Code for Windows and Unix 363 Interfacing with COM 366 Interacting with ODBC Data Sources 372 A. Function Reference . 377 B. Extension Overview . 491 Index . 503 viii | Table of Contents Foreword Today, PHP is the most widely used programming language on the Web, with over 40 percent of all web applications written in PHP. It is installed on over 22 million domain servers (source: Netcraft), as shown in Figure F-1. The number of develop- ers using PHP has now reached over 2.5 million. The community developing PHP is very impressive, withover 450 CVS committers whowrote a total of 1 million lines of code. The PHP community is one of the most dynamic, with thousands of people sharing code, evangelizing about PHP, supporting each other, and creating many projects suchas Wikipedia, Mambo, PHP-Nuke, FUDforum, SugarCRM, and Horde, just to mention a few. IBM, Oracle Endorse PHP PHP 5.0 Yahoo! • XML, SOAP, OOP 20M Standardizes • Zend Studio on PHP PHP 4 15M Released • 1M Internet domains • Zend Engine • Zend Founded Zeek Suraski, Andi Gutmans 10M Rasmus develop Lerdolf PHP 3 develops PHP/Fl 5M PHP internet domains 1995 1997 1999 2000 2002 2004 2005 Figure F-1. PHP development timeline with usage Its simplicity is what made PHP so successful. Simplicity equals less code. Develop- ers and companies have been developing projects with PHP in a fraction of the time it would take another language. ix This is the Title of the Book, eMatter Edition Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved. Download from Wow! eBook <www.wowebook.com> Objects andPDO. issues suchas extending and securing PHP,are and getting discusses quality newer information. features It ofnizable covers XML all names and of in the the importantThis PHP PHP topics, community book plus have is unique contributed a to must-have it. forrenowned expertiseinupdatingthe“Security”chapter. So anybody you working know with thatthis PHP. you Some book. of Wez the modernizedyears most experience the recog- in “Extending PHP. PHP”revision Wez project chapter, Furlong is and and Peter Chrisand Chris MacIntyre, Kevin brought Shiflett a Tatroe his have Zend providedRasmus also Certified the Lerdorf, contributed guidelines Engineer the for to withmore initial this creator thanfive book. of The the first newest version author of on PHP the (then calledSupport fortheEclipseDevelopmentplatform PHP/FI), Zend PHPFramework ment anddeploymentenvironment.TheProject’sfirsttwoopeninitiativesare: level by creating an industrial-grade,munity de members facto around standard new PHP open webtion source application Project initiatives develop- initiated aimed by at Zend takingMySQL, Technologies PHP rallies Intel, to many the and, leading next most companies recently,The and Red future com- Hat of have PHP all looks endorsed very it. bright. The Leading new platform Collabora- vendors such as IBM, Oracle, x | clean, crisp,clear,correctwaystowritecode.ItisthewarbetweenPHPandC++/Java. who want simple,It sloppy, is flexible, a war humanThere between ways is the an to humans unacknowledged and write war the that code computer goes and scientists. on It every those is day who a in want the war world between of those programming. in collaborationwithpartners,aPHPIDEbasedontheEclipseplatform. Zend is joining the Eclipse Foundation as a Strategic Developer.opment anddeploymentofmission-criticalPHPwebapplications. It will develop, This is a web application framework that will accelerate and improve the devel- Foreword Copyright ©2007O’Reilly&Associates, Inc.Allrightsreserved. This istheTitleofBook,eMatter Edition Zend Technologies,Inc.,thePHPCompany Vice President,Marketing —Adam Bosworth —Michel Gerin Google Preface1 Now more than ever, the Web is a major vehicle for corporate and personal commu- nications. Web sites carry satellite images of Earthin its entirety, searchfor life in outer space, and house personal photo albums, business shopping carts, and prod- uct lists. Many of those web sites are driven by PHP, an open source scripting lan- guage primarily designed for generating HTML content. Since its inception in 1994, PHP has swept the Web and continues its phenomenal growthwithrecent endorsements by IBM and ORACLE corporations (to name a few).
Recommended publications
  • SEO Footprints
    SEO Footprints Brought to you by: Jason Rushton Copyright 2013 Online - M a r k e t i n g - T o o l s . c o m Page 1 Use these “Footprints” with your niche specific keywords to find Backlink sources. Some of the footprints below have already been formed into ready made search queries. TIP* If you find a footprint that returns the results you are looking for, there is no need to use the rest in that section. For example if I am looking for wordpress sites that allow comments and the search query “powered by wordpress” “YOUR YOUR KEYWORDS” returns lots of results there is no need to use all of the others that target wordpress sites as a lot of them will produce similar results. I would use one or two from each section. You can try them out and when you find one you like add it to your own list of favourites. Blogs “article directory powered by wordpress” “YOUR YOUR KEYWORDS” “blog powered by wordpress” “YOUR YOUR KEYWORDS” “blogs powered by typepad” “YOUR YOUR KEYWORDS” “YOURYOUR KEYWORDS” inurl:”trackback powered by wordpress” “powered by blogengine net 1.5.0.7” “YOUR YOUR KEYWORDS” “powered by blogengine.net” “YOUR YOUR KEYWORDS” “powered by blogengine.net add comment” “YOUR YOUR KEYWORDS” “powered by typepad” “YOUR YOUR KEYWORDS” “powered by wordpress” “YOUR YOUR KEYWORDS” “powered by wordpress review theme” “YOUR YOUR KEYWORDS” “proudly powered by wordpress” “YOUR YOUR KEYWORDS” “remove powered by wordpress” “YOUR YOUR KEYWORDS” Copyright 2013 Online - M a r k e t i n g - T o o l s .
    [Show full text]
  • Open Source Ethos Guiding Beliefs Or Ideals That Characterize a Community
    Open Source Ethos guiding beliefs or ideals that characterize a community Patrick Masson Open Source Initiative [email protected] What is the mission of the conference? …bring smart and creative people together; …inspire and motivate them to create new and amazing things; …with an intimate group of like minded individuals. What is the mission of the conference? …bring smart and creative people together; …inspire and motivate them to create new and amazing things; …with an intimate group of like minded individuals. This is the open source ethos – guiding beliefs, ideals of a community It's a great time to be working with open source 1.5 Million Projects 78% of companies run on open source 64% of companies participate It's a great time to be working with open source 88% expect contributions to grow 66% consider before proprietary <3% Don't use OSS 2015 Future of Open Source Survey Black Duck, Northbridge It's a great time to be working with open source It's a great time to be working with open source It's a great time to be working with open source It's a great time to be working with open source Open-course/Open-source Marc Wathieu CC-BY-NC-SA https://www.flickr.com/photos/marcwathieu/2412755417/ _____ College first Massive Open source Online Course (MOOC) Are you seeing other examples of this Mini-MOOC trend (free, I began but did not finish my first The Gates grantees aren’t the only ones open source courses by a MOOC (Massive Open-Source, startup or organization)? Online Course).
    [Show full text]
  • Katalog Elektronskih Knjiga
    KATALOG ELEKTRONSKIH KNJIGA Br Autor Naziv Godina ISBN Str. Porijeklo izdavanja 1 Peter Kent Pay Per Click Search 2006 0-471-74594-3 130 Kupovina Engine Marketing for Dummies 2 Terry Large Access 1 2007 Internet Freeware 3 Kevin Smith Excel Lassons & Tutorials 2004 Internet Freeware 4 Terry Michael Photografy Tutorials 2006 Internet Freeware Janine Peterson Phil Pivnick 5 Jake Ludington Converting Vinyl LPs 2003 Internet Freeware to CD 6 Allen Wyatt Cleaning Windows XP 2004 0-7645-7311-X Poklon for Dummies 7 Peter Kent Sarch Engine Optimization 2006 0-4717-5441-2 Kupovina for Dummies 8 Terry Large Access 2 2007 Internet Freeware 9 Dirk Dupon How to write, create, 2005 Internet Freeware promote and sell E-books on the Internet 10 Chayden Bates eBook Marketing 2000 Internet Freeware Explained 11 Kevin Sinclair How To Choose A 1999 Internet Freeware Homebased Bussines 12 Bob McElwain 101 Newbie-Frendly Tips 2001 Internet Freeware 13 Windows Basics 2004 Poklon 14 Michael Abrash Zen of Graphic 2005 Poklon Programming, 2. izdanje 15 13 Hot Internet 2000 Internet Freeware Moneymaking Methods 16 K. Williams The Complete HTML 1998 Poklon Teacher 17 C. Darwin On the Origin of Species Internet Freeware 2/175 Br Autor Naziv Godina ISBN Str. Porijeklo izdavanja 18 C. Darwin The Variation of Animals Internet Freeware 19 Bruce Eckel Thinking in C++, Vol 1 2000 Internet Freeware 20 Bruce Eckel Thinking in C++, Vol 2 2000 Internet Freeware 21 James Parton Captains of Industry 1890 399 Internet Freeware 22 Bruno R. Preiss Data Structures and 1998 Internet
    [Show full text]
  • Producing Open Source Software How to Run a Successful Free Software Project
    Producing Open Source Software How to Run a Successful Free Software Project Karl Fogel Producing Open Source Software: How to Run a Successful Free Software Project by Karl Fogel Copyright © 2005-2018 Karl Fogel, under the CreativeCommons Attribution-ShareAlike (4.0) license. Version: 2.3098 Home site: http://producingoss.com/ Dedication This book is dedicated to two dear friends without whom it would not have been possible: Karen Under- hill and Jim Blandy. i Table of Contents Preface ............................................................................................................................. vi Why Write This Book? ............................................................................................... vi Who Should Read This Book? .................................................................................... vii Sources ................................................................................................................... vii Acknowledgements ................................................................................................... viii For the first edition (2005) ................................................................................ viii For the second edition (2017) ............................................................................... x Disclaimer .............................................................................................................. xiii 1. Introduction ...................................................................................................................
    [Show full text]
  • Rapid Development
    REVIEWS Zend Studio 4 Exploring the Zend Studio 4 developer environment RAPID DEVELOPMENT PHP experts consider Zend Studio the most mature and feature-rich IDE for PHP. The latest version offers enhanced database manip- ulation and other improvements. We’ll put the Zend Studio IDE through its paces and show you how you can use it to speed up PHP development. BY CARSTEN MÖHRKE he choice of an integrated devel- opment environment is often a Tmatter of taste. Many PHP devel- opers prefer text editors like Emacs or Vim. Developers who favor a more inte- grated approach have several choices in the Linux world. The free Quanta Plus IDE, the closed source Maguma environ- ment, and even Eclipse (with the right Zend Studio has set of plug-ins) are all genuine alterna- the reputation of being tives to an editor. For PHP developers, one of the most mature and pow- erful IDEs. version that disables so many useful Zend Studio Personal Edition Zend Studio is the brainchild of Isra- features it is not really worth the effort The following features are not available el’s Zend Software, a vendor that prefers (see the box titled “Zend Studio Personal in Zend Studio Personal Edition: to be known as “The PHP Company.” Edition”). Older versions often suffered from per- • Profiler Installation • Code Analyzer formance problems or instability, but the • CVS support latest version, Zend Studio 4, is an After downloading and unpacking the extremely powerful and stable developer 47MByte archive, you can launch the • Inspectors environment. Zend Studio is neither installation program directly.
    [Show full text]
  • Introduction to Python for IBM I
    Introduction to Python for IBM i Mike Pavlak – IT Strategist [email protected] Agenda ■ A little about Python ■ Why use Python ■ How to install/determine if installed ▶IDE ■ Syntax 101 ▶Variables ▶Strings ▶Functions 2 Acknowledgements ■ Kevin Adler ■ Tony Cairns ■ Jesse Gorzinski ■ Google ■ Memegenerator ■ Corn chips and salsa ■ Parrots ■ And, of course, spam 3 A little about Python What is it, really? ■ General purpose language ■ Easy to get started ■ Simple syntax ■ Great for integrations (glue between systems) ■ Access to C and other APIs ■ Infrastructure first, but applications, too 5 Historically… ■ Python was conceptualized by Guido Van Rossum in the late 1980’s ■ Rossum published the first version of Python code (0.9.0) in February of 1991 at the CWI(Centrum Wiskunde & Informatica) in the Netherlands, Amsterdam ■ Python is derived from the ABC programming language, which is a general purpose language that was also developed at CWI. ■ Rossum chose the name “Python” since he was a fan of Monty Python’s Flying Circus. ■ Python is now maintained by a core development team at the institute, although Rossum still holds a vital role in directing its progress and as leading “commitor”. 6 Python lineage ■ Python 1 – 1994 ■ Python 2 – 2000 (Not dead yet…) ▶2.7 – 2010 ■ Python 3 – 2008 ▶3.5 – 2015 ▶3.6.2 – July 2017 ▶3.7 ➔ ETA July 2018 7 Python 2 or 3? 8 What’s the diff? ■ Example: ▶Python 2 print statement replaced by function ● Python 2 – print “Hello World!” ● Python 3 – print(“Hello World!”) ■ Many more differences, tho…
    [Show full text]
  • Linux Lunacy V & Perl Whirl
    SPEAKERS Linux Lunacy V Nicholas Clark Scott Collins & Perl Whirl ’05 Mark Jason Dominus Andrew Dunstan Running Concurrently brian d foy Jon “maddog” Hall Southwestern Caribbean Andrew Morton OCTOBER 2ND TO 9TH, 2005 Ken Pugh Allison Randal Linux Lunacy V and Perl Whirl ’05 run concurrently. Attendees can mix and match, choosing courses from Randal Schwartz both conferences. Doc Searls Ted Ts’o Larry Wall Michael Warfield DAY PORT ARRIVE DEPART CONFERENCE SESSIONS Sunday, Oct 2 Tampa, Florida — 4:00pm 7:15pm, Bon Voyage Party Monday, Oct 3 Cruising The Caribbean — — 8:30am – 5:00pm Tuesday, Oct 4 Grand Cayman 7:00am 4:00pm 4:00pm – 7:30pm Wednesday, Oct 5 Costa Maya, Mexico 10:00am 6:00pm 6:00pm – 7:30pm Thursday, Oct 6 Cozumel, Mexico 7:00am 6:00pm 6:00pm – 7:30pm Friday, Oct 7 Belize City, Belize 7:30am 4:30pm 4:30pm – 8:00pm Saturday, Oct 8 Cruising The Caribbean — — 8:30am – 5:00pm Sunday, Oct 9 Tampa, Florida 8:00am — Perl Whirl ’05 and Linux Lunacy V Perl Whirl ’05 are running concurrently. Attendees can mix and match, choosing courses Seminars at a Glance from both conferences. You may choose any combination Regular Expression Mastery (half day) Programming with Iterators and Generators of full-, half-, or quarter-day seminars Speaker: Mark Jason Dominus Speaker: Mark Jason Dominus (half day) for a total of two-and-one-half Almost everyone has written a regex that failed Sometimes you’ll write a function that takes too (2.5) days’ worth of sessions. The to match something they wanted it to, or that long to run because it produces too much useful conference fee is $995 and includes matched something they thought it shouldn’t, and information.
    [Show full text]
  • When Geeks Cruise
    COMMUNITY Geek Cruise: Linux Lunacy Linux Lunacy, Perl Whirl, MySQL Swell: Open Source technologists on board When Geeks Cruise If you are on one of those huge cruising ships and, instead of middle-aged ladies sipping cocktails, you spot a bunch of T-shirt touting, nerdy looking guys hacking on their notebooks in the lounges, chances are you are witnessing a “Geek Cruise”. BY ULRICH WOLF eil Baumann, of Palo Alto, Cali- and practical tips on application develop- The dedicated Linux track comprised a fornia, has been organizing geek ment – not only for Perl developers but meager spattering of six lectures, and Ncruises since 1999 (http://www. for anyone interested in programming. though there was something to suit geekcruises.com/), Neil always finds everyone’s taste, the whole thing tended enough open source and programming Perl: Present and to lack detail. Ted T’so spent a long time celebrities to hold sessions on Linux, (Distant?) Future talking about the Ext2 and Ext3 file sys- Perl, PHP and other topics dear to geeks. In contrast, Allison Randal’s tutorials on tems, criticizing ReiserFS along the way, Parrot Assembler and Perl6 features were but had very little to say about network Open Source Celebs hardcore. Thank goodness Larry Wall file systems, an increasingly vital topic. on the Med summed up all the major details on Perl6 Developers were treated to a lecture on I was lucky enough to get on board the in a brilliant lecture that was rich with developing shared libraries, and admins first Geek Cruise on the Mediterranean, metaphors and bursting with informa- enjoyed sessions on Samba and hetero- scaring the nerds to death with my tion.
    [Show full text]
  • Java Bytecode Manipulation Framework
    Notice About this document The following copyright statements and licenses apply to software components that are distributed with various versions of the OnCommand Performance Manager products. Your product does not necessarily use all the software components referred to below. Where required, source code is published at the following location: ftp://ftp.netapp.com/frm-ntap/opensource/ 215-09632 _A0_ur001 -Copyright 2014 NetApp, Inc. All rights reserved. 1 Notice Copyrights and licenses The following component is subject to the ANTLR License • ANTLR, ANother Tool for Language Recognition - 2.7.6 © Copyright ANTLR / Terence Parr 2009 ANTLR License SOFTWARE RIGHTS ANTLR 1989-2004 Developed by Terence Parr Partially supported by University of San Francisco & jGuru.com We reserve no legal rights to the ANTLR--it is fully in the public domain. An individual or company may do whatever they wish with source code distributed with ANTLR or the code generated by ANTLR, including the incorporation of ANTLR, or its output, into commerical software. We encourage users to develop software with ANTLR. However, we do ask that credit is given to us for developing ANTLR. By "credit", we mean that if you use ANTLR or incorporate any source code into one of your programs (commercial product, research project, or otherwise) that you acknowledge this fact somewhere in the documentation, research report, etc... If you like ANTLR and have developed a nice tool with the output, please mention that you developed it using ANTLR. In addition, we ask that the headers remain intact in our source code. As long as these guidelines are kept, we expect to continue enhancing this system and expect to make other tools available as they are completed.
    [Show full text]
  • Letter, If Not the Spirit, of One Or the Other Definition
    Producing Open Source Software How to Run a Successful Free Software Project Karl Fogel Producing Open Source Software: How to Run a Successful Free Software Project by Karl Fogel Copyright © 2005-2021 Karl Fogel, under the CreativeCommons Attribution-ShareAlike (4.0) license. Version: 2.3214 Home site: https://producingoss.com/ Dedication This book is dedicated to two dear friends without whom it would not have been possible: Karen Under- hill and Jim Blandy. i Table of Contents Preface ............................................................................................................................. vi Why Write This Book? ............................................................................................... vi Who Should Read This Book? ..................................................................................... vi Sources ................................................................................................................... vii Acknowledgements ................................................................................................... viii For the first edition (2005) ................................................................................ viii For the second edition (2021) .............................................................................. ix Disclaimer .............................................................................................................. xiii 1. Introduction ...................................................................................................................
    [Show full text]
  • PHP Beyond the Web Shell Scripts, Desktop Software, System Daemons and More
    PHP Beyond the web Shell scripts, desktop software, system daemons and more Rob Aley This book is for sale at http://leanpub.com/php This version was published on 2013-11-25 This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do. ©2012 - 2013 Rob Aley Tweet This Book! Please help Rob Aley by spreading the word about this book on Twitter! The suggested hashtag for this book is #phpbeyondtheweb. Find out what other people are saying about the book by clicking on this link to search for this hashtag on Twitter: https://twitter.com/search?q=#phpbeyondtheweb Contents Welcome ............................................ i About the author ...................................... i Acknowledgements ..................................... ii 1 Introduction ........................................ 1 1.1 “Use PHP? We’re not building a website, you know!”. ............... 1 1.2 Are you new to PHP? ................................. 2 1.3 Reader prerequisites. Or, what this book isn’t .................... 3 1.4 An important note for Windows and Mac users ................... 3 1.5 About the sample code ................................ 4 1.6 External resources ................................... 4 1.7 Book formats/versions available, and access to updates ............... 5 1.8 English. The Real English. .............................. 5 2 Getting away from the Web - the basics ......................... 6 2.1 PHP without a web server .............................. 6 2.2 PHP versions - what’s yours? ............................. 7 2.3 A few good reasons NOT to do it in PHP ...................... 8 2.4 Thinking about security ...............................
    [Show full text]
  • Appendix a the Ten Commandments for Websites
    Appendix A The Ten Commandments for Websites Welcome to the appendixes! At this stage in your learning, you should have all the basic skills you require to build a high-quality website with insightful consideration given to aspects such as accessibility, search engine optimization, usability, and all the other concepts that web designers and developers think about on a daily basis. Hopefully with all the different elements covered in this book, you now have a solid understanding as to what goes into building a website (much more than code!). The main thing you should take from this book is that you don’t need to be an expert at everything but ensuring that you take the time to notice what’s out there and deciding what will best help your site are among the most important elements of the process. As you leave this book and go on to updating your website over time and perhaps learning new skills, always remember to be brave, take risks (through trial and error), and never feel that things are getting too hard. If you choose to learn skills that were only briefly mentioned in this book, like scripting, or to get involved in using content management systems and web software, go at a pace that you feel comfortable with. With that in mind, let’s go over the 10 most important messages I would personally recommend. After that, I’ll give you some useful resources like important websites for people learning to create for the Internet and handy software. Advice is something many professional designers and developers give out in spades after learning some harsh lessons from what their own bitter experiences.
    [Show full text]