PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY 3. (Jetty web server)

PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY 3. Save contact.php and test the form. When you receive the email, click the Reply button in your email program, and you should see the address that you entered in the form automatically entered in the recipient s address field. You can check your code against contact09.php in the download files. Handling multiple-choice form elements You now have the basic knowledge to process user input from an online form and email it to your inbox, but to keep things simple, the form in contact.php uses only text input fields and a text area. To work successfully with forms, you also need to know how to handle multiple-choice elements, namely: Radio buttons Check boxes Drop-down option menus Multiple-choice lists Figure 5-8 shows contact.php with an example of each type added to the original design. The principle behind them is exactly the same as the text input fields you have been working with: the name attribute of the form element is used as the key in the $_POST array. However, check boxes and multiple-choice lists store the selected values as an array, so you need to adapt the code slightly to capture all the values. Let s look briefly at each type of form element. Rather than go through each step in detail, I ll just highlight the important points. The completed code for the rest of the chapter is in contact10.php.
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

Leave a Reply