Can someone help me with a Dynamic PHP select List?

Rind

New member
How would I create a Dynamic PHP select list with three options, and make it so that the information displayed on the confirmation page corresponded with the option selected? This is for a class project, and I am having difficulty understanding how I would incorporate this into an existing form.

For example: I am adding a drop down menu to an existing PHP form. So far the form is just set up to display a confirmation that echos the information that the user entered. I need to add a drop down menu with three options to this form, and I have three different messages that I want displayed on the confirmation page depending on which option the user selects from the drop down menu.

The current form code is:

HTML:
<div id="form">
<form action="process.php" method=post class="formdata" onblur="MM_validateForm('first_name','','R','last_name','','R','password','','R');return document.MM_returnValue" >
<table width=450 border=0 cellpadding=2 cellspacing=2 bgcolor="">
<tr valign=top>
<td colspan=3><div align=left onblur="MM_validateForm('first_name','','R','last_name','','R','password','','R');return document.MM_returnValue">
<table width=450 border=0 cellpadding=2 cellspacing=2 bgcolor="">
<tr valign=top>
<td colspan=3><div align=left>
<p>Required fields are marked with an asterisk *<br />
<br />
</p>
</div></td>
</tr>
<tr valign=top>
<td align=right width=120 ><div align=left onblur="MM_validateForm('first_name','','R','last_name','','R','email','','RisEmail','password','','R');return document.MM_returnValue">*First Name:</div></td>
<td width=380><input name=first_name id=first_name type=text size=20 /></td>
</tr>
<tr valign=top>
<td ><div align=left>*Last Name: </div></td>
<td ><input name=last_name type=text id=last_name size=20 /></td>
</tr>
<tr valign=top>
<td ><div align=left>*Email Address: </div></td>
<td ><input name=email type=text id=email size=25 /></td>
</tr>
<tr valign=top>
<td ><div align=left>*Password:</div></td>
<td ><input name=password type=text id=password size=20 /></td>
</tr>
<tr valign=top>
<td colspan=2><center>
<input type=submit class=button name=Submit value=Submit />
</center></td>
</tr>
</table>
<p>*</p>
</div></td>
</tr>
</table>
</form>
</div>

PHP:
<?php print "<p> Congratulations $first_name! You may now start selling your photography.</p>
<p>Please make a note of your account details.</p>";
?>

<?php

echo $_POST['first_name']?>
<p><?php echo $_POST['last_name']?></p>
<p>

<?php echo $_POST['email']?></p>
<p>
<?php echo $_POST['password']?></p>



The List options that I would like to add are:

Photographer
Web or Graphic Designer
Marketing Professional

The Corresponding messages are:

The Photographer Page will say:

Welcome Photographer! Don’t forget to upload your formal application as well as any applicable model releases. Focus will review your application and you will receive a response within 3 business days, and you will be able to start selling your photos immediately! In the mean time, feel free to take a look around, and check out our Photographers’ section. Thanks for joining Focus!

The Web/Graphic Designer Page will say:

Welcome Web or Graphic Designer! Focus is excited to provide you with the best stock photography to be found on the web. Check out our great discount packages, or if you prefer you can purchase images as you go. Be sure to check out the Web and Graphic Design page for layout ideas, as well as monthly contest information. Thanks for joining Focus!

The Marketing Professional Page will say:

Welcome Marketing Professional! As a Focus member you will be able to meet your project deadlines with ease. Did you know that you can use phrases when searching for your images? For example, if you are doing a magazine article about exercise and nutrition, try the phrase “Healthy Living”. Remember to bookmark our Marketing Professionals page for weekly articles on how to overcome writers block and tips for selecting the right images. Thanks for joining Focus
 
Back
Top