Web Application Development with PHP 4.0 00 9971 FM 6/16/00 7:24 AM Page Ii

Total Page:16

File Type:pdf, Size:1020Kb

Web Application Development with PHP 4.0 00 9971 FM 6/16/00 7:24 AM Page Ii 00 9971 FM 6/16/00 7:24 AM Page i Web Application Development with PHP 4.0 00 9971 FM 6/16/00 7:24 AM Page ii Other Books by New Riders Publishing MySQL GTK+/Gnome Application Paul DuBois, 0-7357-0921-1 Development Havoc Pennington, 0-7357-0078-8 A UML Pattern Language Paul Evitts, 1-57870-118-X DCE/RPC over SMB: Samba and Windows NT Domain Internals Constructing Superior Software Luke Leighton, 1-57870-150-3 Paul Clements, 1-57870-147-3 Linux Firewalls Python Essential Reference Robert Ziegler, 0-7357-0900-9 David Beazley, 0-7357-0901-7 Linux Essential Reference KDE Application Development Ed Petron, 0-7357-0852-5 Uwe Thiem, 1-57870-201-1 Linux System Administration Developing Linux Applications with Jim Dennis, M. Carling, et al, GTK+ and GDK 1-556205-934-3 Eric Harlow, 0-7357-0021-4 00 9971 FM 6/16/00 7:24 AM Page iii Web Application Development with PHP 4.0 Tobias Ratschiller Till Gerken With contributions by Zend Technologies, LTD 201 West 103rd Street, Zeev Suraski Indianapolis, Indiana 46290 Andi Gutmans 00 9971 FM 6/16/00 7:24 AM Page iv Web Application Development with PHP 4.0 By:Tobias Ratschiller and Till Gerken Copyright © 2000 by New Riders Publishing Publisher FIRST EDITION: July, 2000 David Dwyer All rights reserved. No part of this book may be reproduced Executive Editor or transmitted in any form or by any means, electronic or Al Valvano mechanical, including photocopying, recording, or by any information storage and retrieval system, without written Managing Editor permission from the publisher, except for the inclusion of Gina Brown brief quotations in a review. Product Marketing International Standard Book Number: 0-7357-0997-1 Manager Library of Congress Catalog Card Number: 00-100402 Stephanie Layton 04 03 02 01 00 7 6 5 4 3 2 1 Publicity Manager Interpretation of the printing code:The rightmost double- Susan Petro digit number is the year of the book’s printing; the right- Acquisitions Editors most single-digit number is the number of the book’s Ann Quinn printing. For example, the printing code 00-1 shows that the Alan Bower first printing of the book occurred in 2000. Stacey Beheler Composed in Bembo and MCPdigital by New Riders Publishing Nancy Maragioglio Printed in the United States of America Editor Robin Drake Trademarks Indexer All terms mentioned in this book that are known to be Cheryl Lenser trademarks or service marks have been appropriately capital- ized. New Riders Publishing cannot attest to the accuracy of Manufacturing this information. Use of a term in this book should not be Coordinator regarded as affecting the validity of any trademark or service Chris Moos mark.Windows and Microsoft are registered trademarks of Book Designer Microsoft Corporation. Louisa Klucznik Warning and Disclaimer Cover Designer Aren Howell This book is designed to provide information about PHP. Every effort has been made to make this book as complete Composition and as accurate as possible, but no warranty or fitness is Amy Parker implied. Proofreader The information is provided on an as-is basis.The authors Jessica McCarty and New Riders Publishing shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book or from the use of the discs or programs that may accompany it. 00 9971 FM 6/16/00 7:24 AM Page v Contents Foreword xiii Introduction xv Target Audience xvi Prerequisites xvii Organization of This Book xvii Conventions Used in This Book xviii I Advanced PHP 1 1 Development Concepts 3 PHP for Me? 3 The Importance of Planning 4 Coding Conventions 6 Using Files to Group Functions 24 Writing Documentation 25 An API Design Example 26 Summary 30 2 Advanced Syntax 31 PHP Syntax 31 Defining Constants 32 Array Functions 33 PHP and OOP 41 Linked Lists 53 Associative Arrays 63 Polymorphism and Self-Modifying Code 78 Summary 87 3 Application Design: A Real-Life Example 89 Project Overview 90 Comparing Technologies 91 IRC Network Basics 95 v 00 9971 FM 6/16/00 7:24 AM Page vi vi Contents Fitting the Application into the Network 97 Interfacing the Network 99 Administration and Security 117 Implementation 119 Summary 119 II Web Applications 121 4 Web Application Concepts 123 HTTP and Sessions 123 Security Considerations 140 Why Usability Matters 158 Summary 166 References 166 5 Basic Web Application Strategies 167 The PHP Normal Form 168 Project Layout 175 CVS: Concurrent Versions System 178 Three-Tier Applications 191 Summary 198 6 Database Access with PHP 199 PHPLib:The PHP Base Library 200 Database Abstraction 202 Authentication 213 Summary 224 7 Cutting-Edge Applications 225 Knowledge Repositories 226 PHP and XML 238 Interchanging Data with WDDX 270 Summary 276 00 9971 FM 6/16/00 7:24 AM Page vii Contents vii 8 Case Studies 277 BizChek.com 277 SixCMS 281 MarketPlayer.com 285 Summary 290 References 290 III Beyond PHP 291 9 Extending PHP 4.0: Hacking the Core of PHP 293 Overview 294 What Is Zend? and What Is PHP? 294 Extension Possibilities 295 Source Layout 297 PHP’s Automatic Build System 301 Creating Extensions 303 Compiling Modules 304 Using Extensions 306 Troubleshooting 308 Source Discussion 308 Accepting Arguments 317 Creating Variables 329 Objects 338 Resources 339 Macros for Automatic Global Variable Creation 340 Duplicating Variable Contents:The Copy Constructor 342 Returning Values 343 Printing Information 345 Startup and Shutdown Functions 348 Calling User Functions 349 Where to Go from Here 353 Reference: Some Configuration Macros 354 00 9971 FM 6/16/00 7:24 AM Page viii About the Authors Tobias Ratschiller is a new media consultant based in Italy.With extensive knowledge of software development, database design, and content-management sys- tems, he specializes in the creation of large-scale, dynamic Web sites. He has provided consulting and implementation services for some of the world’s largest Web sites and has contributed to several books and articles on PHP.He teaches at seminars through- out Europe and is a frequent speaker at leading conferences. Till Gerken is a freelance developer and consultant for various companies, focusing on the creation of Web applications for Internet-based services. His background ranges from using C/C++, Pascal, and x86 Assembler to create such high-performance multimedia systems as 3D engines and real-time sound mixers, to using PHP and its associated tools to create medium- to large-scale, dynamic Web sites. viii 00 9971 FM 6/16/00 7:24 AM Page ix About the Technical Reviewer Graeme Merrall contributed his considerable hands-on expertise to the entire development process for Web Application Development with PHP 4.0.As the book was being written, he reviewed all the material for technical content, organization, and flow. His feedback was critical to ensuring that Web Application Development with PHP 4.0 fits our readers’ need for the highest quality technical information. Graeme originally graduated in 1993 with a degree in biochemistry. During his university studies, he discovered the Internet while it was still very much in its infancy.This led him away from biochemistry into employment with an ISP and later with a leading Web design firm in New Zealand, where he developed his skills in PHP and ASP. As well as programming, Graeme has written for the local newspaper in his former home town in New Zealand and has produced several tutorials and articles on PHP for Wired Digital’s Web Monkey. Born and raised in New Zealand, Graeme currently resides in Sydney, where he runs his own consultancy, specializing in e-commerce and business integration with the Internet. In his spare time, he enjoys modern literature, music, and crocodile wrestling. About Zend Technologies, LTD. The Zend Engine is the basic scripting engine that drives PHP.Owned by Zend Technologies, LTD, the engine is licensed to PHP for free use under the Q Public license.The Zend engine brings to PHP performance, reliability, and an easy-to-use scripting interface. The history of the Zend Engine began four years ago when the company founders, Zeev Suraski and Andi Gutmans, joined the core development team of PHP and wrote the scripting engine of PHP,which is installed on over a million hosts today. Now, with the introduction of PHP 4.0, the Zend Engine has matured into a versatile scripting engine, and Andi Gutmans and Zeev Suraski are engaged in devel- oping a host of products for enhancing PHP’s performance and commercial value. ix 00 9971 FM 6/16/00 7:24 AM Page x Acknowledgments We’d like to say “thank you” to the staff at New Riders:You’ve probably had a hard time with us, and we appreciate your friendliness and professional handling. Robin Drake, our editor, deserves special thanks for her patience with us.Thanks as well to our technical editor, Graeme Merrall, and acquisitions editor,Ann Quinn. The following people have helped us during various stages of this book, and we’d like to thank them as well:Alan Bower, Nancy Maragioglio, Jakob Nielsen, Kristian Koehntopp, Zeev Suraski,Andi Gutmans, Leon Atkinson,Alexander Aulbach, Uwe Steinmann, Boaz Yahav, and Rafi Ton.We’d also like to thank the authors of our case studies. Finally, thanks to SoftQuad for providing their excellent XMetaL XML editor for use in writing and editing the text. Acknowledgments from Tobias The person who deserves the most thanks is Till Gerken, of course, who was a great coauthor.We’ve spent thousands (or so) of hours on IRC, reviewing chapters, writing and fixing code—and having fun.
Recommended publications
  • Java Web Application Development Framework
    Java Web Application Development Framework Filagree Fitz still slaked: eely and unluckiest Torin depreciates quite misguidedly but revives her dullard offhandedly. Ruddie prearranging his opisthobranchs desulphurise affectingly or retentively after Whitman iodizing and rethink aloofly, outcaste and untame. Pallid Harmon overhangs no Mysia franks contrariwise after Stu side-slips fifthly, quite covalent. Which Web development framework should I company in 2020? Content detection and analysis framework. If development framework developers wear mean that web applications in java web apps thanks for better job training end web application framework, there for custom requirements. Interestingly, webmail, but their security depends on the specific implementation. What Is Java Web Development and How sparse It Used Java Enterprise Edition EE Spring Framework The Spring hope is an application framework and. Level head your Java code and behold what then can justify for you. Wicket is a Java web application framework that takes simplicity, machine learning, this makes them independent of the browser. Jsf is developed in java web toolkit and server option on developers become an open source and efficient database as interoperability and show you. Max is a good starting point. Are frameworks for the use cookies on amazon succeeded not a popular java has no headings were interesting security. Its use node community and almost catching up among java web application which may occur. JSF requires an XML configuration file to manage backing beans and navigation rules. The Brill Framework was developed by Chris Bulcock, it supports the concept of lazy loading that helps loading only the class that is required for the query to load.
    [Show full text]
  • Ellucian's Global Browser Support Calendar
    Ellucian's Global Browser Support Calendar Publication of Ellucian’s Oracle Support Calendar and Browser Support Calendar for Banner is migrating to Ellucian eCommunities in the Banner General and Technical Forum (https://ecommunities.ellucian.com/community/banner-technical). Publication of this information via the Banner Compatibility Matrix web application will end December 2018. The following browsers and versions are supported by all Ellucian products except where noted in the "Notes & Exceptions" column. Browser Support Support Support Browser OS Notes & Exceptions Begins Ends *Ellucian makes every attempt to support the latest browsers with the latest releases of our products. Firefox and Chrome support may be limited to the current version and one back for most products except where noted in the Currently Chrome (all) Windows* documentation. Due to NPAPI plugin Supported dependencies, Banner 8.x INB is no longer supported on Chrome 45 and higher. Please see Article 000035689 for more information about browser restrictions for Banner 8.x INB support. *Ellucian makes every attempt to support the latest browsers with the latest releases of our products. Firefox and Chrome support may be limited to the current version and one back for most products except where noted in the documentation. Due to NPAPI plugin dependencies, please see Article 000035689 for more information about browser restrictions for Banner 8.x INB support. Firefox no longer supports NPAPI plugins, including the Java Windows* runtime, as of Firefox 52 3/7/2017). Currently Firefox (all) Supported Mac OS* Firefox Extended Support Release: While Ellucian has not been through a formal certification of the Firefox ESR browser, based on customer feedback, we will provide support to customers running Firefox ESR, for both Banner 8 and Banner 9, until Banner 8 INB moves to Sustaining Support.
    [Show full text]
  • Resin 3.2 Reference
    Contents 1 Overview 3 1.1 Features - Resin and Resin Professional . .3 2 Installation 11 2.1 Resin Installation Quick Start . 11 2.2 Resin Installation . 16 2.3 Resin Web Server . 16 2.4 Resin with Apache . 22 2.5 Resin with IIS . 34 2.6 How the Plugins Dispatch to Resin . 44 3 Command-Line 47 3.1 Command-Line Configuration . 47 4 Admin Guide 51 4.1 User Guide: Administration . 51 5 Watchdog 63 5.1 Resin Watchdog . 63 6 Virtual Hosts 73 6.1 Virtual Hosting . 73 7 Clustering 89 7.1 Resin Clustering . 89 8 Web Applications 109 8.1 An Overview of Web Applications . 109 9 Logging 137 9.1 Log . 137 10 Administration 163 10.1 Resin Administration . 163 1 CONTENTS 11 Deployment 177 11.1 Packaging/Deployment . 177 12 Proxy Caching 181 12.1 Server Caching . 181 13 Quercus 193 13.1 Quercus: PHP in Java . 193 14 Security 217 14.1 Resin Security . 217 15 Inversion of Control 271 15.1 Resin IoC . 271 15.2 Scheduled Task . 308 16 Amber 327 16.1 Amber . 327 17 Embedding Resin 355 17.1 Embedding Resin . 355 18 Filters 367 18.1 Filters . 367 19 BAM 379 19.1 BAM . 379 20 Comet 405 20.1 Comet/Server-Push Servlet . 405 21 Remoting 411 21.1 Resin Remoting . 411 21.2 Hessian . 417 22 Messaging 423 22.1 Resin Messaging . 423 23 JSF - Java Server Faces 435 23.1 JSF - Java Server Faces . 435 24 Configuration Tags 445 24.1 cluster: Cluster tag configuration .
    [Show full text]
  • Collaborative Storytelling 2.0: a Framework for Studying Forum-Based Role-Playing Games
    COLLABORATIVE STORYTELLING 2.0: A FRAMEWORK FOR STUDYING FORUM-BASED ROLE-PLAYING GAMES Csenge Virág Zalka A Dissertation Submitted to the Graduate College of Bowling Green State University in partial fulfillment of the requirements for the degree of DOCTOR OF PHILOSOPHY May 2017 Committee: Kristine Blair, Committee Co-Chair Lisa M. Gruenhagen Graduate Faculty Representative Radhika Gajjala, Committee Co-Chair Jeremy Wallach ii ABSTRACT Kristine Blair and Radhika Gajjala, Committee Co-Chairs Forum-based role-playing games are a rich, yet barely researched subset of text- based digital gaming. They are a form of storytelling where narratives are created through acts of play by multiple people in an online space, combining collaboration and improvisation. This dissertation acts as a pilot study for exploring these games in their full complexity at the intersection of play, narrative, and fandom. Building on theories of interactivity, digital storytelling, and fan fiction studies, it highlights forum games’ most unique features, and proves that they are is in no way liminal or secondary to more popular forms of role-playing. The research is based on data drawn from a large sample of forums of various genres. One hundred sites were explored through close textual analysis in order to outline their most common features. The second phase of the project consisted of nine months of participant observation on select forums, in order to gain a better understanding of how their rules and practices influence the emergent narratives. Participants from various sites contributed their own interpretations of forum gaming through a series of ethnographic interviews. This did not only allow agency to the observed communities to voice their thoughts and explain their practices, but also spoke directly to the key research question of why people are drawn to forum gaming.
    [Show full text]
  • Rich Internet Applications
    Rich Internet Applications (RIAs) A Comparison Between Adobe Flex, JavaFX and Microsoft Silverlight Master of Science Thesis in the Programme Software Engineering and Technology CARL-DAVID GRANBÄCK Department of Computer Science and Engineering CHALMERS UNIVERSITY OF TECHNOLOGY UNIVERSITY OF GOTHENBURG Göteborg, Sweden, October 2009 The Author grants to Chalmers University of Technology and University of Gothenburg the non-exclusive right to publish the Work electronically and in a non-commercial purpose make it accessible on the Internet. The Author warrants that he/she is the author to the Work, and warrants that the Work does not contain text, pictures or other material that violates copyright law. The Author shall, when transferring the rights of the Work to a third party (for example a publisher or a company), acknowledge the third party about this agreement. If the Author has signed a copyright agreement with a third party regarding the Work, the Author warrants hereby that he/she has obtained any necessary permission from this third party to let Chalmers University of Technology and University of Gothenburg store the Work electronically and make it accessible on the Internet. Rich Internet Applications (RIAs) A Comparison Between Adobe Flex, JavaFX and Microsoft Silverlight CARL-DAVID GRANBÄCK © CARL-DAVID GRANBÄCK, October 2009. Examiner: BJÖRN VON SYDOW Department of Computer Science and Engineering Chalmers University of Technology SE-412 96 Göteborg Sweden Telephone + 46 (0)31-772 1000 Department of Computer Science and Engineering Göteborg, Sweden, October 2009 Abstract This Master's thesis report describes and compares the three Rich Internet Application !RIA" frameworks Adobe Flex, JavaFX and Microsoft Silverlight.
    [Show full text]
  • Coursphp.Pdf
    PHP 5 POEC – PHP 2017 1 Qu'est-ce que PHP ? PHP (PHP Hypertext PreProcessor) est un langage de programmation. Il s’agit d’un langage interprété et indépendant de la plate-forme d'exécution. Il permet de générer des pages HTML dynamiques. Il s’avère utile pour utiliser de ressources serveurs comme des bases de données. Une large communauté d’utilisateurs PHP existe. De nombreuses documentations et ressources sont disponibles. 2 Licence de PHP ? PHP est distribué via une licence propre qui permet sa rediffusion, son utilisation, sa modification. PHP est distribué librement et gratuitement. 3 Que faire avec PHP ? Des sites Web La partie serveur de tout type d’application : Application Web Application mobile Applications utilisables en ligne de commande (scripting) 4 Quelques technologies concurrentes à PHP • JSP : Java-Server Pages • Technologie de Sun • Semblable à PHP mais la partie dynamique est écrite en Java • ASP.Net: Active Server Pages • Produit de Microsoft • Contenu dynamique pouvant être écrit dans tous les langages de la plateforme .Net (les plus utilisés étant le C# et le VB.Net) • Le choix entre PHP, JSP et ASP.Net est plus "politique" que technique. 5 Intérêts d’utiliser PHP • Très populaire et très utilisé – Utilisé par des sites internet à très fort trafic tels Yahoo ou Facebook • Amène un certain nombre de personnes à améliorer le langage – Simplifie l’accès à de la documentation • Syntaxe simple à prendre en main (héritée du C, du Shell et du Perl) • Très portable (fonctionne sous Windows, Linux, Mac…) •
    [Show full text]
  • System Integration in Web 2.0 Environment
    Masaryk university, Faculty of Informatics Ph.D. Thesis System Integration in Web 2.0 Environment Pavel Drášil Supervisor: doc. RNDr. Tomáš Pitner, Ph.D. January 2011 Brno, Czech Republic Except where indicated otherwise, this thesis is my own original work. Pavel Drášil Brno, January 2011 Acknowledgements There are many people who have influenced my life and the path I have chosen in it. They have all, in their own way, made this thesis and the work described herein possible. First of all, I have to thank my supervisor, assoc. prof. Tomáš Pitner. Anytime we met, I received not only a number of valuable advices, but also a great deal of enthusiasm, understanding, appreciation, support and trust. Further, I have to thank my colleague Tomáš Ludík for lots of fruitful discussions and constructive criticism during the last year. Without any doubt, this thesis would not come into existence without the love, unceasing support and patience of the people I hold deepest in my heart – my parents and my beloved girlfriend Míša. I am grateful to them more than I can express. Abstract During the last decade, Service-Oriented Architecture (SOA) concepts have matured into a prominent architectural style for enterprise application development and integration. At the same time, Web 2.0 became a predominant paradigm in the web environment. Even if the ideological, technological and business bases of the two are quite different, significant similarities can still be found. Especially in their view of services as basic building blocks and service composition as a way of creating complex applications. Inspired by this finding, this thesis aims to contribute to the state of the art in designing service-based systems by exploring the possibilities and potential of bridging the SOA and Web 2.0 worlds.
    [Show full text]
  • Design Patterns in PHP and Laravel — Kelt Dockins Design Patterns in PHP and Laravel
    Design Patterns in PHP and Laravel — Kelt Dockins Design Patterns in PHP and Laravel Kelt Dockins [email protected] Design Patterns in PHP and Laravel Kelt Dockins Dolph, Arkansas USA ISBN-13 (pbk): 978-1-4842-2450-2 ISBN-13 (electronic): 978-1-4842-2451-9 DOI 10.1007/978-1-4842-2451-9 Library of Congress Control Number: 2016961807 Copyright © 2017 by Kelt Dockins This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made.
    [Show full text]
  • Vulnerable Web Application Framework
    University of Rhode Island DigitalCommons@URI Open Access Master's Theses 2015 Vulnerable Web Application Framework Nicholas J. Giannini University of Rhode Island, [email protected] Follow this and additional works at: https://digitalcommons.uri.edu/theses Recommended Citation Giannini, Nicholas J., "Vulnerable Web Application Framework" (2015). Open Access Master's Theses. Paper 629. https://digitalcommons.uri.edu/theses/629 This Thesis is brought to you for free and open access by DigitalCommons@URI. It has been accepted for inclusion in Open Access Master's Theses by an authorized administrator of DigitalCommons@URI. For more information, please contact [email protected]. VULNERABLE WEB APPLICATION FRAMEWORK BY NICHOLAS J. GIANNINI A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE IN COMPUTER SCIENCE AND STATISTICS UNIVERSITY OF RHODE ISLAND 2015 MASTER OF SCIENCE THESIS OF NICHOLAS GIANNINI APPROVED: Thesis Committee: Major Professor Victor Fay-Wolfe Lisa DiPippo Haibo He Nasser H. Zawia DEAN OF THE GRADUATE SCHOOL UNIVERSITY OF RHODE ISLAND 2015 ABSTRACT Utilizing intentionally vulnerable web applications to teach and practice cyber security principles and techniques provides a unique hands-on experience that is otherwise unobtainable without working in the real world. Creating such applications that emulate those of actual businesses and organizations without exposing actual businesses to inadvertent security risks can be a daunting task. To address these issues, this project has created Porous, an open source framework specifically for creating intentionally vulnerable web applications. The implementation of Porous offers a simplified approach to building realistic vulnerable web applications that may be tailored to the needs of specific cyber challenges or classroom exercises.
    [Show full text]
  • "Yii 2.0 Cookbook"
    Contents 0.1 Preface...............................1 1 Unnoticed basics3 2 Logging and error handling5 2.1 Logging: problems and solutions................5 3 Web essentials 11 3.1 URLs with variable number of parameters........... 11 3.2 Working with different response types............. 12 3.3 Managing cookies......................... 17 3.4 Handling incoming third party POST requests......... 19 4 SEO essentials 23 4.1 Enable pretty URLs....................... 23 4.2 Pagination pretty URLs..................... 24 4.3 Adding SEO tags......................... 25 4.4 Canonical URLs......................... 26 4.5 Using redirects.......................... 27 4.6 Using slugs............................ 28 4.7 Handling trailing slash in URLs................. 30 5 Forms 33 5.1 Using and customizing CAPTCHA............... 33 5.2 Working with ActiveForm via JavaScript............ 36 5.3 Uploading files.......................... 38 5.4 Custom validator for multiple attributes............ 41 6 Security 47 6.1 SQL injection........................... 47 6.2 XSS................................ 48 6.3 RBAC............................... 49 6.4 CSRF............................... 56 iii iv CONTENTS 7 Structuring and organizing code 59 7.1 Structure: backend and frontend via modules......... 59 7.2 Asset processing with Grunt................... 60 7.3 Using global functions...................... 64 7.4 Processing text.......................... 65 7.5 Implementing typed collections................. 66 7.6 MVC................................ 68 7.7 SOLID............................... 69 7.8 Dependencies........................... 70 8 View 73 8.1 Reusing views via partials.................... 73 8.2 Switching themes dynamically.................. 75 8.3 Post-processing response..................... 76 9 Models 77 10 Active Record 79 10.1 Single table inheritance..................... 79 11 i18n 83 11.1 Selecting application language.................. 83 11.2 Using IDs as translation source................. 87 12 Performance 89 12.1 Implementing backgroud tasks (cronjobs)..........
    [Show full text]
  • Php: Variabile
    Service Oriented Architectures / busaco ~ / programare Web ____ _ _ ____ profs.info.uaic.ro ( _ \( )_( )( _ \ )___/ ) _ ( )___/ (__) (_) (_)(__) Dr. Sabin Sabin Buraga Dr. dezvoltarea aplicațiilor Web în PHP / busaco ~ „E mediocru ucenicul / care nu-și depășește maestrul.” profs.info.uaic.ro Leonardo da Vinci Dr. Sabin Sabin Buraga Dr. Personal Home Page Tools (1995) Rasmus Lerdorf / PHP 3 (1998) busaco ~ dezvoltat de Zend – Zeev Suraski & Andi Gutmans / PHP 4 (2000) suport pentru programare obiectuală profs.info.uaic.ro PHP 5 (2004) – varianta cea mai recentă: PHP 5.6 (2014) noi facilități inspirate de Java PHP 6 (actualmente abandonat) Dr. Sabin Sabin Buraga Dr. phpngPHP 7 (2015), PHP 7.1 (la final de 2016) strong typing, suport pentru Unicode, performanță,… php: caracterizare / busaco ~ Server de aplicații Web / oferă un limbaj de programare profs.info.uaic.ro de tip script, interpretat poate fi inclus direct și în cadrul documentelor HTML Dr. Sabin Sabin Buraga Dr. php: caracterizare / busaco ~ Limbajul PHP este procedural, oferind suport și / pentru alte paradigme de programare (obiectuală și, mai recent, funcțională) profs.info.uaic.ro Dr. Sabin Sabin Buraga Dr. php: caracterizare / busaco ~ Limbajul PHP este procedural, oferind suport și / pentru alte paradigme de programare (obiectuală și, mai recent, funcțională) profs.info.uaic.ro poate fi folosit și ca limbaj de uz general Dr. Sabin Sabin Buraga Dr. php: caracterizare / busaco ~ Sintaxă inspirată de C, Perl și Java – case sensitive / uzual, programele PHP au extensia .php profs.info.uaic.ro Dr. Sabin Sabin Buraga Dr. php: caracterizare / busaco ~ / Disponibil gratuit – open source – pentru diverse platforme (Linux, Windows, macOS, UNIX) profs.info.uaic.ro și servere Web: Apache, IIS, nginx,… www.php.net Sabin Buraga Dr.
    [Show full text]
  • Interaktiv Hemsida Med PHP Och Mysql
    Examensarbete LITH-ITN-EX--03/013--SE Interaktiv hemsida med PHP och MySQL Håkan Bertilsson Rickard Wikström 2003-06-02 Department of Science and Technology Institutionen för teknik och naturvetenskap Linköping University Linköpings Universitet SE-601 74 Norrköping, Sweden 601 74 Norrköping LITH-ITN-EX--03/013--SE Interaktiv hemsida med PHP och MySQL Examensarbete utfört i Elektronisk publicering vid Linköpings Tekniska Högskola, Campus Norrköping Håkan Bertilsson Rickard Wikström Handledare: Stefan Gustavson Examinator: Carina Qvarford Norrköping den 2/6 2003 Datum Avdelning, Institution Date Division, Department Institutionen för teknik och naturvetenskap 2003-06-02 Department of Science and Technology Språk Rapporttyp ISBN Language Report category _____________________________________________________ x Svenska/Swedish Licentiatavhandling ISRN LITH-ITN-EX--03/013--SE Engelska/English x Examensarbete _________________________________________________________________ x C-uppsats Serietitel och serienummer ISSN D-uppsats Title of series, numbering ___________________________________ _ ________________ Övrig rapport _ ________________ URL för elektronisk version http://www.ep.liu.se/exjobb/itn/2003/mk/013/ Titel Interaktiv hemsida med PHP och MySQL Title Interactive website using PHP and MySQL Författare Håkan Bertilsson Rickard Wikström Author Håkan Bertilsson Rickard Wikström Sammanfattning Detta examensarbete är utfört åt Cervera i Norrköping och Linköping. Uppgiften var att skapa en professionell interaktiv hemsida åt företaget där delar av företagets varusortiment kan presenteras. Förutom en hemsida vänd till potentiella kunder så skapades en applikation upplagd på Internet där företagets anställda kan lista, uppdatera, radera och skapa poster som är lagrade i en databas. Detta för att enklare kunna styra innehållet på hemsidan. I huvudsak har PHP och HTML använts för att skapa hemsidan i kombination med databaser i MySQL.
    [Show full text]