The Hello World script, like most PHP scripts for the Web, is written mainly
to output HTML code that the browser then processes and displays in your
Web page. When writing PHP code to deliver output to a Web browser, you
need to keep in mind that there are two stages, as follows: Read the rest of this entry »
Processing PHP output statements
Writing Your First PHP Script
It’s sort of a tradition that the first program you write in any language is the
Hello World program. You may have written a Hello World program in
HTML when you first learned it. If you did, it probably looked similar to the
following HTML file: Read the rest of this entry »
Choosing a Web hosting company
A Web hosting company provides everything you need to put up a Web site,
including the computer space and all the Web site software. You just create
the files for your Web pages and move them to a location specified by the
Web hosting company. Read the rest of this entry »
Using an existing Web environment
When you use a Web environment set up by someone else, you don’t need
to understand the installation and administration of the Web site software.
Someone else — your company’s IT department, a commercial Web hosting
company, your next-door neighbor — is responsible for the operation of the
Web site. It’s their job to provide you with a working Web site, including PHP
if it’s required. Your job is only to write and install the Web site files. Read the rest of this entry »
Establishing Your Web Environment
PHP for Web development runs in partnership with a Web server, as described
in Chapter 1. Thus, a Web site requires a Web server. To use PHP in your Web
site, the Web server must be able to exchange information with the PHP software, and, thus, PHP must be installed where the Web server can access it.
The Web site environment involves more than just a Web server and PHP on a computer. Here are a few other requirements:
Previous versions of PHP
You should be aware of some significant changes in previous PHP versions
because existing scripts that work fine on earlier versions may have problems
when they’re run on a later version, and vice versa. The following are some
changes you should be aware of: Read the rest of this entry »
PHP 5
Most of the important changes in PHP version 5 don’t affect the coding or the
use of PHP. They affect the performance of PHP. The Zend engine (the magic,
invisible engine that powers PHP) has been significantly improved, and as a
result, scripts run faster and more efficiently. Read the rest of this entry »
Keeping Up with Changes in PHP
PHP is open source software. If you have only used software from major software
publishers — such as Microsoft, Macromedia, or Adobe — you will find
that open source software is an entirely different species. It’s developed by a
group of programmers who write the code in their spare time, for fun and for
free. There’s no corporate office to call with questions. There’s no salesperson
to convince you of the wonders of the software. There’s no technical support
phone number where you can be put on hold. Read the rest of this entry »
Using PHP for database applications
PHP is particularly strong in its ability to interact with databases. PHP supports
pretty much every database you’ve ever heard of and some you haven’t.
PHP handles connecting to the database and communicating with it, so you
don’t need to know the technical details for connecting to a database or for
exchanging messages with it. You tell PHP the name of the database and
where it is, and PHP handles the details. It connects to the database, passes
your instructions to the database, and returns the database response to you. Read the rest of this entry »
Using PHP for Web applications
In the beginning, Web pages were static — they just presented documents.
Users went to Web sites to read information. Documents were linked together
so that users could easily find the information they sought, but the Web pages
didn’t change. Every user who arrived at a Web page saw the same thing. Read the rest of this entry »