PHP 5/MySQL Programming- P12:computer programming has often been seen as a difficult and arcane skill. Programming languages are difficult and complicated, out of the typical person’s reach. However, the advent of the World Wide Web has changed that to some extent. It’s reasonably easy to build and post a Web page for the entire world to see. The language of the Web is reasonably simple, and numerous applications are available to assist in the preparation of static pages | 33 Most of the math symbols you are familiar with also work with numeric variables. The plus sign is used for addition the minus sign - indicates subtraction the asterisk multiples and the forward slash divides. The remainder of the program illustrates how PHP does subtraction multiplication and division. Creating a Form to Ask a Question It s very typical for PHP programs to be made of two or more separate documents. An ordinary HTML page contains a form which the user fills out. When the user presses the submit button the information in all the form elements is sent to a program specified by a special attribute of the form. This program processes the information from the form and returns a result which looks to the user like an ordinary Web page. To illustrate look at the page illustrated in Figure . figure This ordinary HTML page contains a form. Chapter 2 Using Variables and Input The page does not contain any PHP at all. It s simply an HTML page with a form on it. When the user clicks the Submit Query button the page sends the value in the text area to a PHP program called . Figure shows what happens when the program runs. It s important to recognize that two different pages are involved in the transaction. In this section you learn how to link an HTML page to a particular script and how to write a script that expects certain form information. 34 PHP 5 MySQL Programming for the Absolute Beginner figure The resulting page uses the value from the original HTML form. Building an HTML Page with a Form Forms are very useful when you want to get information from the user. To illustrate how this is done look at the code html head title What s your name title head body h1 What s your name h1 h3 Writing a form for user input h3 form method post action Please type your name input type text name userName value br input type submit form body html 35 There is only one element of .