3) Ask a user to input their name into a textfield and to choose a color from a popup menu. Then display a page with a short message (e.g. "Thank you $_REQUEST['name'] for your request") in that color. a) Form:
Type in your name, please:

b) PHP Script: User Preferences '> Thank you '' for your request. ------------------------------------------------------------------ 4) In the previous script check whether the input is reasonable and not empty: - check whether the name and color contain only word characters or -. - check that neither name nor color is longer than 100 chars (use the {100,} multiplier). If the criteria are not fulfilled, do not display the results page but instead show an error message. User Preferences 100 or strlen($_REQUEST['name']) > 100){ echo "Invalid Input"; exit; } ?> '> Thank you '' for your request. ------------------------------------------------------------------ 5) For the $_REQUEST['name'] variable replace HTML characters "<" and ">" with < and > before printing the name. (Note: if this is combined with exercise 4, the regular expression for $name must be changed to $name =~ /[^&#;\w-]/ otherwise it would die anyway if it sees HTML tags.) User Preferences 100 or strlen($_REQUEST['name']) > 100){ echo "Invalid Input"; exit; } ?> '> Thank you '' for your request.