This is the first book to comprehensively address PHP and how it can&;and should&;be deployed on the IBM i. With this IBM i-specific point of view, the authors examine how to transfer skills from a green screen environment to the Web, become intimately familiar with PHP&;s commonly used features, and help start down the road of highly interactive Web-based application development.
For decades, the green screen has been the ubiquitous interface into an organization&;s data. But with the advent of HTML, the Internet, and the browser, combined with the end user&;s existing familiarity with the Web, green-screen developers are seeing much of the demand for their skills diminish in favor of more Web-enabled technologies. One of those technologies is the PHP programming language.
A flexible, forgiving programming style makes PHP easier to learn, and is just one of the many reasons PHP tops the list when developers seek to improve their Web-related skills. While not limited to Web development, PHP is designed from the ground up to be the ideal environment to easily build simple or complex Web-based applications in the most effective manner possible, while still giving programmers the control they need.
With this book you will learn to:
> Build basic PHP applications and how to structure them
> Access local and remote resources, as well as external data sources
> Manage persistence between requests and the life of an individual  request from browser to server to browser
> Tap System i DB2 database tables from PHP
> Install and access MySQL databases on the System i
Die Inhaltsangabe kann sich auf eine andere Ausgabe dieses Titels beziehen.
Jeff Olen is the owner and founder of Olen Business Consulting Inc. and has developed PHP applications on the System i for a wide variety of clients. In addition to extensive development experience with RPG, he has also developed applications using C, C++, Javascript, HTML, PHP and MySQL. He lives in Orange, California. Kevin Schroeder is a technical consultant for Zend Technologies and has developed production software using a wide variety of languages including PHP, Java, Javascript, HTML, SQL, Perl, Visual Basic, ASP, and C. He lives in Frisco, Texas.
Title Page,
Copyright Page,
Dedication,
Acknowledgements,
About the Authors,
Introduction,
1 - Getting Started,
2 - Language Basics,
3 - Control Structures and Loops,
4 - Arrays,
5 - Functions,
6 - Files and Streams,
7 - Classes,
8 - Database Access,
9 - Sessions and Cookies,
10 - Zend Core for i5/OS,
A - Zend Studio for i5/OS,
B - Frameworks,
MC | PRESSonline,
Getting Started
PHP is the successor of a product called PHP/FI, which was written by Rasmus Lerdorf in 1995. PHP/FI, which stood for Personal Home Page/ Forms Interpreter, was a set of scripts used to monitor and maintain Web pages. The PHP language as we know it today was created in 1997 by Andi Gutmans and Zeev Suraski and was a complete rewrite of the original PHP/FI 2.0. The version of PHP eventually released late in 1998 was called PHP 3.0. (Those interested in the historical releases of PHP can find them at http://museum.pdh.net) The name "PHP" is a recursive acronym that stands for "PHP: Hypertext Preprocessor."
Today's PHP has gone through several rounds of improvements to become a robust and powerful server-side tool for developing dynamic Web content. However, for those of us who have spent our careers working on the IBM System i and its many predecessors, there has been little to interest us about PHP — that is, until recently. Now, Zend Technologies has partnered with IBM to develop a version of the Zend Core for i5/OS. Zend Core is a high- quality (read "supported") version of PHP 5. As of this writing, the current version of Zend Core for i5/OS, Version 2.6, provides the basis for developing PHP-based applications that run natively on the System i. Perhaps best of all for System i developers, two PHP extensions, IBM_DB2 and PDO_IBM, enable us to develop applications that access IBM DB2 database files.
So, there now exists a simple (relatively speaking) tool we can use to develop enterprise-level Web content on the System i. What are we waiting for? Um ... good question. Let's get started.
Static vs. Dynamic Content
A static Web page or static Hypertext Markup Language (HTML) undergoes no changes or tailoring before being displayed to the ultimate end user. We can liken this type of interface to that of a DDS display file that contains nothing but literals and thus always displays the same thing. Another way to think of static HTML is as "hard-coded" HTML.
Although there's nothing wrong with static content or static HTML, your ability to create complex and interesting Web content is severely limited in this context. For example, suppose you'd like to display the current time and a simple personalized greeting message for each user. You cannot do these things with static HTML, although static HTML can have dynamic elements through the use of a client-side scripting language, such as JavaScript.
Dynamic content is content that responds to user interaction. To some degree, every Web site is dynamic, in that it responds to a user's actions and because HTTP is a request/response protocol. But for the purposes of our discussion, dynamic content refers to content that can react and change based on some kind of programmatic expression either on the server side or on the client side. And because we're talking PHP, we're talking server side. What this means is that you use PHP to generate some kind of content on a Web server. Although the first type of content that might come to your mind is HTML, that is only one type of many. You can render HTML, images, Portable Document Format (PDF) documents, JavaScript Object Notation (JSON), Extensible Markup Language (XML), and a host of different types of content using PHP.
You create dynamic content in different ways depending on which tools you are using. One important difference has to do with where the scripting programs are interpreted: on the local PC or on the Web server. These two distinctions are commonly referred to as client-side scripting and server-side scripting.
Client-side vs. Server-side
JavaScript is one example of a client-side scripting language with which you're probably familiar. JavaScript is usually interpreted on the client, although some Web servers can interpret it as a server-side language. In basic terms, this means that the JavaScript source code is transmitted to the client and then executed on the client machine. This approach has several drawbacks, not the least of which is that it can be slow, especially if you lack a high-speed network connection. Another drawback is that the source code is transmitted to the client. This exposure means that nothing confidential or business-related should be included in any way in the source code.
In server-side scripting, the script is executed on the server machine. In this case, the execution speed is limited not by the speed of your connection (at least not as much) but rather by the speed of the host machine. Also, because the source code always remains on the server, it can contain confidential information and business rules (unless your Web server or application has some kind of vulnerability).
What You'll Need
To follow along with the examples and exercises presented here and get the most from the information in this book, you should have the Zend Core for i5/OS installed on your System i. You'll also need one of the integrated development environments (IDEs) for PHP; we use the Zend Studio. Other IDEs are available, and you're free to use whichever one you feel most comfortable with. To be honest, there is nothing to stop you from loading PHP on your local machine and running your own Apache Web server. This setup is perfectly fine for most of the exercises that relate to PHP in general. However, later on we'll address topics that relate specifically to developing applications on and for the System i. At that time, you'll need access to an iSeries with PHP installed on it. The good news is that Zend Core and Zend Studio for i5/OS are both available for free; you can download them from the Zend Web site, http://www.zend.com.
Both products come with PDF installation documents that are fairly straightforward and easy to follow. This documentation lists several IBM licensed programs as prerequisites. These programs are all included on your i5/OS installation media, but, as optional components, they may not have been preloaded on your machine. If the required programs are not loaded, you can either load them from your installation media or contact your IBM SE and order them. Ordering the media should be free as long as you are on software support.
To stay focused on getting you coding PHP as quickly as possible, we're going to forego providing detailed install instructions here. The installation guide includes reasonably good troubleshooting tips in case you run into problems. The Zend Support Forums (http://www.zend.com/forums) provide further information, and you can find good answers to your questions there.
Two other tools may be useful for you, although neither is required:
• Smarty: This fairly robust templating engine is handy for quickly creating uniform-looking pages. However, it adds another layer of processing between PHP and the final HTML output. Smarty is available at...
„Über diesen Titel“ kann sich auf eine andere Ausgabe dieses Titels beziehen.
Anbieter: Reliant Bookstore, El Dorado, KS, USA
Zustand: good. This book is in good condition with very minimal damage. Pages may have minimal notes or highlighting. Cover image on the book may vary from photo. Ships out quickly in a secure plastic mailer. Bestandsnummer des Verkäufers RDV.1583470832.G
Anzahl: 1 verfügbar
Anbieter: Zoom Books East, Glendale Heights, IL, USA
Zustand: very_good. Book is in very good condition and may include minimal underlining highlighting. The book can also include "From the library of" labels. May not contain miscellaneous items toys, dvds, etc. . We offer 100% money back guarantee and 24 7 customer service. Bestandsnummer des Verkäufers ZEV.1583470832.VG
Anzahl: 1 verfügbar