question archive In this exercise, you will create an All-in-One form that is a work- ing “Contact Me” page
Subject:Computer SciencePrice: Bought3
In this exercise, you will create an All-in-One form that is a work- ing “Contact Me” page. This page will have inputs for the subject, the sender’s name, the sender’s e-mail address, and the message. The form will also send a copy of the message to the sender. 1. Create a new document in your text editor. Type the !DOCTYPE declaration, element, header information, and element. Use the strict DTD and “Contact Me” as the content of the element. 2. Add the opening and closing tags for the PHP script section in the body of the document: <?php ?>3. Add a function called validateInput(). This function takes two parameters. The ?rst parameter, $data, is a string to be validated. The second parameter, $?eldName, is the name of the form ?eld. The function returns the $data parameter after it has been cleaned up. Notice that the function uses the global variable $errorCount. 225 function validateInput($data, $?eldName) { global $errorCount; if (empty($data)) { echo "\"$?eldName\"" is a required ?eld.\n"";