PHP 4: A Beginner's Guide

( 2 )

Overview

Essential skills for first-time programmers! PHP 4: A Beginner's Guide explains the fundamentals of this hot programming language. You'll learn to create forms, work with functions, use cookies, access relational databases, and debug PHP scripts. The modular approach of this series—including drills, sample projects, and mastery checks—makes it easy to learn PHP 4 programming quickly.

Essential skills for first-time programmers! PHP 4: A Beginner's Guide explains the ...

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (10) from $1.99   
  • New (3) from $30.68   
  • Used (7) from $1.99   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$30.68
Seller since 2015

Feedback rating:

(346)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
Brand New Item.

Ships from: Chatham, NJ

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$45.00
Seller since 2015

Feedback rating:

(218)

Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
$45.00
Seller since 2015

Feedback rating:

(218)

Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Close
Sort by
Sending request ...

Overview

Essential skills for first-time programmers! PHP 4: A Beginner's Guide explains the fundamentals of this hot programming language. You'll learn to create forms, work with functions, use cookies, access relational databases, and debug PHP scripts. The modular approach of this series—including drills, sample projects, and mastery checks—makes it easy to learn PHP 4 programming quickly.

Essential skills for first-time programmers! PHP 4: A Beginner's Guide explains the fundamentals of this hot programming language. You'll learn to create forms, work with functions, use cookies, access relational databases, and debug PHP scripts. The modular approach of this series--including drills, sample projects, and mastery checks--makes it easy to learn PHP 4 programming quickly.

Read More Show Less

Product Details

  • ISBN-13: 9780072133714
  • Publisher: McGraw-Hill Osborne
  • Publication date: 7/28/2001
  • Series: Beginner's Guide Series
  • Pages: 544
  • Product dimensions: 7.40 (w) x 9.10 (h) x 1.24 (d)

Meet the Author

Bill McCarty has written more than ten programming books, on topics including Java, distributed computing, C++, and Linux, and is a contributing editor for Linux Magazine, for which he writes a monthly column. He is Associate Professor of Web and Information Technology in the School of Business and Management at Azusa Pacific University, Azusa, California, where he taught for seven years in that school's M.S. Applied Computer Science program. Bill earned a PhD in Management of Information Systems at the Claremont Graduate University, Claremont, California and has worked for fifteen years as a software developer and manager. He currently resides in La Habra, California with his family.
Read More Show Less

Read an Excerpt

Module 1: Creating PHP Programs

In this module, you'll learn how to create and execute PHP programs. If PHP is not installed on your system, you're not ready to run the sample PHP programs given in this module. Before attempting to do so, you should install and test PHP by following the instructions given in Appendix B.

Creating a PHP Script

A PHP script can be quite simple or quite complex. However, creating even a complex PHP script is quite straightforward, requiring nothing more than an ordinary text editor. In this section, you'll learn how to create simple PHP scripts that send text output to a web browser. You'll also learn how to document your scripts so that you and others can readily understand their purpose and structure.

Writing PHP Scripts

To create PHP scripts, most PHP programmers use an ordinary text editor. You can use any text editor you like. Under Microsoft Windows, PHP programmers often use the Windows Notepad program. If you prefer, you can use WordPad or even a word processor, such as Microsoft Word. However, if you use a tool other than Notepad, you must be careful to save your script as a text document; otherwise, the script file contains formatting information that will confuse the PHP server.

If you use UNIX or Linux, you can create PHP scripts by using a program such as vi, emacs, or pico. It really doesn't matter what program you choose, so long as the program can create ASCII text files.

Writing the PHP Code Skeleton

Every PHP program includes two special lines that signal the PHP server that the text between them consists of PHP statements. You can think of these lines as bookends that hold your PHP program together.

To begin writing a PHP program, launch your preferred text editor and type the following two lines into the editor's workspace:

<?php
?>

Ask the Expert

Question: When I write C programs, I use an interactive development environment (IDE), such as Microsoft Visual C++, which provides a host of special features that make it easier to design, code, and test my programs. Are there any IDEs for PHP?

Answer: Some text editors, such as vi, provide special support for writing PHP programs. For example, vi's syntax coloring feature renders various PHP program elements in different colors. Many PHP programmers find that syntax coloring makes it easier for them to spot errors in their programs.

Some HTML editors, such as Allaire's HomeSite, provide syntax coloring and other features that aid PHP programmers, such as on-line manuals and expression builders. However, when you're first learning to write PHP programs, you'll probably find it easier to use an ordinary text editor than an editor equipped with special PHP features. Otherwise, you may spend much of your time learning to use the tool rather than learning to write PHP programs. Once you become more proficient in writing PHP programs, you should investigate tools that may help you work better. At that point, check out the PHP Editors list, available on the Web at http://www.itworks.demon.co.uk/phpeditors.htm.


Then, save your basic script as a text file having a name that satisfies the following rules:

  • The filename should consist only of lowercase letters, digits, and dashes. In particular, spaces and other special characters are forbidden.
  • The filename extension should be .php.
Be sure to choose a meaningful name that describes the function of your script, so that you'll be able to readily identify it weeks or months after you create it. You'll find that dashes are handy for separating the words that make up the file name, making the file name easier to read. For example, a file that contains a PHP script that lets you view inventory stock levels might be named stock-levels.php. Long after you create that file, you won't have a problem figuring out what the script does.

Ask the Expert

Question: These file-naming rules seem quite restrictive. Can't I .: use other characters in naming files that contain PHP scripts?

Answer: Yes, you can. But, using other characters is likely to get you into trouble. For example, Microsoft Windows filenames are case insensitive whereas UNIX file names are case sensitive. And, most operating systems prescribe file naming rules that differ from the rules that Web addresses (URLs) must obey. You can avoid the problems that arise because of such differences by using only lowercase letters, digits, and dashes in your PHP script file names.


1-Minute Drill
  • Which of the following filenames obey the rules given for naming files that contain PHP scripts?
  • MyScript.php
  • your script.php
  • his-script.php3
  • her-script.php

Creating Output for a Web Browser

PHP programs perform three basic kinds of operations.
  • They obtain data from a user.
  • They perform computations and access and manipulate data stored in and databases.
  • They display data so that a user can view it....
Read More Show Less

Table of Contents

Acknowledgments
Introduction
1 Creating PHP Programs 3
2 PHP Building Blocks 19
3 Creating HTML Forms 37
4 Accessing Data 65
5 Working with Scalar Values 79
6 Writing Conditional Statements 99
7 Using Functions 127
8 Using Arrays 149
9 Using Strings 171
10 Using Cookies 199
11 Working with Files and Directories 211
12 Sending and Receiving E-mail 261
13 Relational Database and SQL Primer 293
14 Accessing Relational Databases 339
15 Using Classes and Objects 381
16 Using Application Templates 403
17 Debugging PHP Scripts 417
App. A: Answers to Mastery Checks 441
App. B Installing PHP 457
App. C PHP Resources 465
App. D Unix Essentials 469
App. E: Escapes 493
App. F ASCII 495
App. G PHP Operators 501
App. H: Security 505
App. I PHP Functions 511
Index 545
Read More Show Less

Customer Reviews

Average Rating 3
( 2 )
Rating Distribution

5 Star

(1)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(1)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 2 Customer Reviews
  • Anonymous

    Posted November 7, 2002

    First Book, excelent buy

    Having prior HTML knowledge, taken a C++ class in college (UGH... WHAT A COMPLETE WASTE OF MONEY!!!!) and debugging (not actually building functional enterprize code) Java and TCL at work, i found this book to be excelent. Examples are clear, and well explained, online source code is available (which is a plus). Only draw back, it left me hungry for more. Off to buy another book, more advanced this time.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted December 1, 2008

    No text was provided for this review.

Sort by: Showing all of 2 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)