HTML Primer

If you’re an HTML wizard and have an in-depth understanding of the structure of HTML, you can probably skip this section, but for those of you who’ve never dissected HTML code or the HTML specification, read on. You’ll recall that PHP’s “middle name” is hypertext and that alone tells you that PHP is intertwined with […]

Accessing PHP and HTTP Data

You know how HTTP works and you basically understand clients and servers, so you’re very cognizant of the interaction between your browser (a client application) and the Web server (a server application) when running PHP programs online. In this chapter you explore HTML forms and examine how they facilitate user interactions with the Web server […]

The Roots of PHP

PHP is a programming language designed to work with HTML, but unlike HTML, PHP has data processing capabilities. If you are familiar with HTML, you know that it is not really a programming language, but more of a rendering language—that is, HTML enables you to write Web pages using code that creates a pleasing (hopefully) display […]

Operators and Expressions

Processing data is accomplished in PHP, as it is in other programming languages, by way of operators and expressions. Operators are the symbols that tell PHP what operations to perform, and expressions are the individual sets of variables and operators that make a result when processing is complete. PHP Operators In PHP, you create a […]

Installing PHP5 with Linux and Apache

At the time of this writing, the very first release candidate of PHP5 was available, and that’s the one we’re using. But you may want to check the PHP site for more recent versions, and any notes about changes. The combination of Linux, Apache, MySQL, and PHP is probably the most common production environment for […]

Hidden Form Fields

There are times when you want to take information contained in a Web page, and pass it to another Web page without requiring any input from the user. There’s another setting for the <input> control that enables you to pass information in a field just as if it were a text box but keeping the control and […]

Using Values Returned From Forms in Your PHP Scripts

You’ve seen all manner of controls, and how PHP handles their contents, but you still haven’t done anything practical with the contents other than to dump them into another Web page. Admittedly, without any of the features that you’ll learn, manipulating the contents of variables is hard. However, you learned about mathematical and string operators […]

Radio Buttons

Radio buttons are the selfish cousins to check boxes. If you have a selection of answers or options but only one of the options can be selected at a time, then you should use radio buttons. Once again, radio buttons are created using the <input>element setting the type attribute to Radio. <input name=”Question1″ type=”radio” value=”Porto”> Radio buttons, like […]

Installing, Configuring, and Running PHP

Before you can write a PHP application that works with your Web pages, you need to have PHP installed and configured. Because you’ll be writing a Web application, it’s a given that you’ll need a Web server and some Web pages. You’ll also need to download, install, and configure PHP, so we provide complete instructions […]