Php

 

Embed or link this publication

Description

ejemplos de codigos de php

Popular Pages


p. 1

gutmans_frontmatter page i thursday september 23 2004 9:05 am php 5 power programming

[close]

p. 2

gutmans_frontmatter page ii 1 wednesday september 15 9:05 am perens_series_7x9.25.fm page thursday september 23 20042004 10:54 am bruce perens open source series http www.phptr.com/perens java application development on linux carl albing and michael schwarz c gui programming with qt 3 jasmin blanchette mark summerfield managing linux systems with webmin system administration and module development jamie cameron mel gorman understanding the linux virtual memory manager implementing cifs the common internet file system christopher hertel anthony massa embedded software development with ecos rapid application development with mozilla nigel mcfarlane the linux development platform configuring using and maintaining a complete programming environment rafeeq ur rehman christopher paul intrusion detection with snort advanced ids techniques using snort apache mysql php and acid rafeeq ur rehman the official samba-3 howto and reference guide john h terpstra jelmer r vernooij editors samba-3 by example practical exercises to successful deployment john h terpstra

[close]

p. 3

gutmans_frontmatter page iii thursday september 23 2004 9:05 am php 5 power programming andi gutmans stig sæther bakken and derick rethans prentice hall professional technical reference indianapolis in 46240 www.phptr.com

[close]

p. 4

gutmans_frontmatter page iv thursday september 23 2004 2:14 pm the authors and publisher have taken care in the preparation of this book but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions no liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein publisher john wait editor in chief don o hagan acquisitions editor mark l taub editorial assistant noreen regina development editor:janet valade marketing manager robin o brien cover designer nina scuderi managing editor gina kanouse senior project editor kristy hart copy editor specialized composition indexer lisa stumpf senior compositor gloria schurick manufacturing buyer dan uhrig the publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales which may include electronic versions and/or custom covers and content particular to your business training goals marketing focus and branding interests for more information please contact u s corporate and government sales 800 382-3419 corpsales@pearsontechgroup.com for sales outside the u s please contact international sales international@pearsoned.com visit us on the web www.phptr.com library of congress cataloging-in-publication data 2004107331 copyright © 2005 pearson education inc this material may be distrubuted only subject to the terms and conditions set forth in the open publication license v1.0 or later the latest version is presently available at http www.opencontent.org/openpub pearson education inc one lake street upper saddle river nj 07458 every effort was made to contact and credit all copyright holders use of material without proper credit is unintentional isbn 0-131-47149-x text printed in the united states on recycled paper at phoenix in hagerstown maryland first printing [october 2004]

[close]

p. 5

gutmans_frontmatter page v thursday september 23 2004 9:05 am to ifat my wife and best friend who has patiently put up with my involement in php from the very beginning and has encouraged and supported me every step of the way andi gutmans to marianne for patience and encouragement stig sæther bakken to my parents who care for me even when i m not around and to 42 the answer to life the universe of everything derick rethans

[close]

p. 6

gutmans_frontmatter page vi thursday september 23 2004 9:05 am

[close]

p. 7

gutmans_frontmatter page vii thursday september 23 2004 9:05 am vii contents foreword by zeev suraski preface introduction and background chapter 1 chapter 2 chapter 3 chapter 4 chapter 5 chapter 6 chapter 7 chapter 8 chapter 9 chapter 10 chapter 11 chapter 12 chapter 13 chapter 14 chapter 15 chapter 16 a b c index what is new in php 5 php 5 basic language php 5 oo language php 5 advanced oop and design patterns how to write a web application with php databases with php 5 error handling xml with php 5 mainstream extensions using pear important pear packages building pear components making the move performance an introduction to writing php extensions php shell scripting pear and pecl package index phpdocumentor format reference zend studio quick start

[close]

p. 8

gutmans_frontmatter page viii thursday september 23 2004 9:05 am

[close]

p. 9

gutmans_toc page ix thursday september 23 2004 9:06 am contents foreword xxi preface xxii 1 what is new in php 5 1 1.1 introduction 1 1.2 language features 1 1.2.1 new object-oriented model 1 1.2.2 new object-oriented features 3 1.2.3 other new language features 7 1.3 general php changes 8 1.3.1 xml and web services 8 1.4 other new features in php 5 11 1.4.1 new memory manager 11 1.4.2 dropped support for windows 95 11 1.5 summary 11 2 php 5 basic language 13 2.1 introduction 13 2.2 html embedding 14 2.3 comments 14 2.4 variables 15 2.4.1 indirect references to variables 16 2.4.2 managing variables 16 2.4.3 superglobals 18 2.5 basic data types 18 2.5.1 integers 19 2.5.2 floating-point numbers 19 2.5.3 strings 19 2.5.4 booleans 22 2.5.5 null 23 ix

[close]

p. 10

gutmans_toc page x thursday september 23 2004 9:06 am x contents 2.5.6 resources 23 2.5.7 arrays 23 2.5.8 constants 30 2.6 operators 31 2.6.1 binary operators 32 2.6.2 assignment operators 32 2.6.3 comparison operators 33 2.6.4 logical operators 34 2.6.5 bitwise operators 35 2.6.6 unary operators 36 2.6.7 negation operators 36 2.6.8 increment/decrement operators 37 2.6.9 the cast operators 38 2.6.10 the silence operator 39 2.6.11 the one and only ternary operator 39 2.7 control structures 39 2.7.1 conditional control structures 39 2.7.2 loop control structures 42 2.7.3 code inclusion control structures 45 2.8 functions 48 2.8.1 user-defined functions 49 2.8.2 function scope 49 2.8.3 returning values by value 50 2.8.4 returning values by reference 51 2.8.5 declaring function parameters 52 2.8.6 static variables 53 2.9 summary 54 3 php 5 oo language 55 3.1 introduction 55 3.2 objects 55 3.3 declaring a class 57 3.4 the new keyword and constructors 57 3.5 destructors 58 3.6 accessing methods and properties using the $this variable 59 3.6.1 public protected and private properties 60 3.6.2 public protected and private methods 61 3.6.3 static properties 62 3.6.4 static methods 64 3.7 class constants 65 3.8 cloning objects 66 3.9 polymorphism 67 3.10 parent and self 70 3.11 instanceof operator 71

[close]

p. 11

gutmans_toc page xi thursday september 23 2004 9:06 am contents xi 3.12 abstract methods and classes 72 3.13 interfaces 73 3.14 inheritance of interfaces 75 3.15 final methods 75 3.16 final classes 76 3.17 tostring method 76 3.18 exception handling 77 3.19 autoload 80 3.20 class type hints in function parameters 82 3.21 summary 83 4 php 5 advanced oop and design patterns 85 4.1 introduction 85 4.2 overloading capabilities 85 4.2.1 property and method overloading 85 4.2.2 overloading the array access syntax 88 4.3 iterators 89 4.4 design patterns 94 4.4.1 strategy pattern 95 4.4.2 singleton pattern 97 4.4.3 factory pattern 98 4.4.4 observer pattern 101 4.5 reflection 103 4.5.1 introduction 103 4.5.2 reflection api 103 4.5.3 reflection examples 106 4.5.4 implementing the delegation pattern using reflection 107 4.6 summary 109 5 how to write a web application with php 111 5.1 introduction 111 5.2 embedding into html 112 5.3 user input 114 5.4 safe-handling user input 117 5.4.1 common mistakes 117 5.5 techniques to make scripts safe 120 5.5.1 input validation 120 5.5.2 hmac verification 122 5.5.3 pear crypt_hmac 124 5.5.4 input filter 127 5.5.5 working with passwords 127 5.5.6 error handling 129 5.6 cookies 131 5.7 sessions 134

[close]

p. 12

gutmans_toc page xii thursday september 23 2004 9:06 am xii contents 5.8 file uploads 137 5.8.1 handling the incoming uploaded file 138 5.9 architecture 143 5.9.1 one script serves all 143 5.9.2 one script per function 144 5.9.3 separating logic from layout 144 5.10 summary 146 6 databases with php 5 149 6.1 introduction 149 6.2 mysql 149 6.2.1 mysql strengths and weaknesses 150 6.2.2 php interface 150 6.2.3 example data 151 6.2.4 connections 151 6.2.5 buffered versus unbuffered queries 153 6.2.6 queries 154 6.2.7 multi statements 155 6.2.8 fetching modes 156 6.2.9 prepared statements 156 6.2.10 blob handling 158 6.3 sqlite 160 6.3.1 sqlite strengths and weaknesses 160 6.3.2 best areas of use 161 6.3.3 php interface 162 6.4 pear db 176 6.4.1 obtaining pear db 176 6.4.2 pros and cons of database abstraction 177 6.4.3 which features are abstracted 177 6.4.4 database connections 178 6.4.5 executing queries 180 6.4.6 fetching results 182 6.4.7 sequences 184 6.4.8 portability features 185 6.4.9 abstracted errors 186 6.4.10 convenience methods 188 6.5 summary 190 7 error handling 191 7.1 introduction 191 7.2 types of errors 192 7.2.1 programming errors 192 7.2.2 undefined symbols 194 7.2.3 portability errors 197

[close]

p. 13

gutmans_toc page xiii thursday september 23 2004 9:06 am contents xiii 7.2.4 runtime errors 201 7.2.5 php errors 201 7.3 pear errors 206 7.3.1 the pear_error class 209 7.3.2 handling pear errors 212 7.3.3 pear error modes 213 7.3.4 graceful handling 213 7.4 exceptions 216 7.4.1 what are exceptions 216 7.4.2 try catch and throw 216 7.5 summary 218 8 xml with php 5 219 8.1 introduction 219 8.2 vocabulary 220 8.3 parsing xml 222 8.3.1 sax 222 8.3.2 dom 226 8.4 simplexml 231 8.4.1 creating a simplexml object 232 8.4.2 browsing simplexml objects 233 8.4.3 storing simplexml objects 234 8.5 pear 234 8.5.1 xml_tree 235 8.5.2 xml_rss 236 8.6 converting xml 239 8.6.1 xslt 239 8.7 communicating with xml 244 8.7.1 xml-rpc 244 8.7.2 soap 252 8.8 summary 259 9 mainstream extensions 261 9.1 introduction 261 9.2 files and streams 261 9.2.1 file access 262 9.2.2 program input/output 264 9.2.3 input/output streams 267 9.2.4 compression streams 268 9.2.5 user streams 270 9.2.6 url streams 271 9.2.7 locking 276 9.2.8 renaming and removing files 277 9.2.9 temporary files 278

[close]

p. 14

gutmans_toc page xiv thursday september 23 2004 9:06 am xiv contents 9.3 regular expressions 279 9.3.1 syntax 279 9.3.2 functions 293 9.4 date handling 301 9.4.1 retrieving date and time information 301 9.4.2 formatting date and time 305 9.4.3 parsing date formats 313 9.5 graphics manipulation with gd 314 9.5.1 case 1 bot-proof submission forms 315 9.5.2 case 2 bar chart 320 9.5.3 exif 326 9.6 multi-byte strings and character sets 329 9.6.1 character set conversions 330 9.6.2 extra functions dealing with multi-byte character sets 335 9.6.3 locales 340 9.7 summary 343 10 using pear 345 10.1 introduction 345 10.2 pear concepts 346 10.2.1 packages 346 10.2.2 releases 346 10.2.3 version numbers 347 10.3 obtaining pear 349 10.3.1 installing with unix linux php distribution 350 10.3.2 installing with php windows installer 351 10.3.3 go-pear.org 351 10.4 installing packages 354 10.4.1 using the pear command 354 10.5 configuration parameters 358 10.6 pear commands 364 10.6.1 pear install 364 10.6.2 pear list 368 10.6.3 pear info 369 10.6.4 pear list-all 370 10.6.5 pear list-upgrades 370 10.6.6 pear upgrade 371 10.6.7 pear upgrade-all 372 10.6.8 pear uninstall 373 10.6.9 pear search 373 10.6.10 pear remote-list 374 10.6.11 pear remote-info 375 10.6.12 pear download 375 10.6.13 pear config-get 376

[close]

p. 15

gutmans_toc page xv thursday september 23 2004 9:06 am contents xv 10.6.14 pear config-set 376 10.6.15 pear config-show 376 10.6.16 shortcuts 377 10.7 installer front-ends 378 10.7.1 cli command line interface installer 378 10.7.2 gtk installer 378 10.8 summary 381 11 important pear packages 383 11.1 introduction 383 11.2 database queries 383 11.3 template systems 383 11.3.1 template terminology 384 11.3.2 html_template_it 384 11.3.3 html_template_flexy 387 11.4 authentication 392 11.4.1 overview 392 11.4.2 example auth with password file 393 11.4.3 example auth with db and user data 394 11.4.4 auth security considerations 396 11.4.5 auth scalability considerations 397 11.4.6 auth summary 398 11.5 form handling 398 11.5.1 html_quickform 398 11.5.2 example login form 399 11.5.3 receiving data 399 11.6 caching 399 11.6.1 cache_lite 399 11.7 summary 401 12 building pear components 403 12.1 introduction 403 12.2 pear standards 403 12.2.1 symbol naming 403 12.2.2 indentation 406 12.3 release versioning 408 12.4 cli environment 408 12.5 fundamentals 410 12.5.1 when and how to include files 410 12.5.2 error handling 411 12.6 building packages 411 12.6.1 pear example helloworld 411 12.6.2 building the tarball 414 12.6.3 verification 414 12.6.4 regression tests 416

[close]

Comments

no comments yet

YOUBLISHER
About
What Others Say
Sitemap
Impressum

PUBLISHERS
Login
Signup
Tutorials
FAQ
Support

BUSINESS
Overview
Advertising
Support

DEVELOPERS
API

LEGAL
Report a Copyright Violation
Copyright FAQ
Terms of Use
Privacy Policy