GO TO to Lab1 #9 php  Lab 01  Labs INDEX

Martha's CIS 52 Lab #1 Exercise #9

Lab #1 Exercise #9. Create a form that asks a user to select a destination from a list of radio buttons. The choices are: San Francisco, New York, London, Paris, Honolulu, and Tokyo.

Write a PHP script that uses a switch statement to evaluate each of the cities, and based on the city selected by the user, sends back a message such as, "Welcome to San Francisco. Be sure to bring your heart and a jacket!" or "Bonjour, let's take a stroll on the left bank!".

For Problem 9:  Please have two files:  one HTML and one PHP

**************************************************************

CODES:

<form name="favoriteCity" action="lab01-09.php" method="post">
<fieldset>
<legend>Choose Your Favorite City</legend>
<input name='selectedCity' type='radio' value='sf' /> San Francisco<br />
<input name='selectedCity' type='radio' value='ny' />New York<br />
<input name='selectedCity' type='radio'value='london' />London<br />
<input name='selectedCity' type='radio' value='paris' />Paris<br />
<input name='selectedCity' type='radio' value='honolulu' />Honolulu<br />
<input name='selectedCity' type='radio' value='tokyo' />Tokyo<br />
</fieldset>
<input name="submit" type="submit" value="Submit" />
</form>

**************************************************************

ANSWER:

Choose Your Favorite City San Francisco
New York
London
Paris
Honolulu
Tokyo