The code I posted is a bit incomplete. You would still need to add a <form> tag with method=post and a a submit button, etc.
The code will only change the options in the second select if you have chosen something in the first select and hit 'submit'. It will only set the value of the second select if you have previously made a selection in the second select box that actually appears in the second select box.
As for the error notices, you should probably set error_reporting to something a little less whiny. Maybe try this:
<?php
error_reporting(E_ALL ^ E_NOTICE);
$material_options = array(
1 => 'Vinyl Banner',
2 => 'Canvas',
3 => 'Poster'
);
# you can define your finishing options depending on what value is chosen for material
# NOTE that I'm using the array indexes from above rather than the long textual name
switch ($_POST['material']) {
case 1:
# Vinyl Banner
$finishing_options = array(
1 => 'Plain Cut ($2.00 / sq ft)',
2 => 'Hemming ($2.50 / sq ft)',
3 => 'Pole Pockets ($2.75 / sq ft)'
);
break;
case 2:
# Canvas
$finishing_options = array(
4 => 'Option 4',
5 => 'Option 5',
6 => 'Option 6'
);
break;
case 3:
# Poster
$finishing_options = array(
7 => 'Option 7',
8 => 'Option 8',
9 => 'Option 9'
);
break;
default:
# if nothing selected...you could also set a var here which might
# disable the finishing select entirely
$finishing_options = array(
10 => 'Option 10',
11 => 'Option 11',
12 => 'Option 12'
);
}
?>
<form method="post" action="">
<select name="material" class="material">
<option value="">--Please select a material--</option>
<?
foreach($material_options as $key => $opt) {
echo ' <option value="' . $key . '"';
if ($_POST['material'] == $key) {
echo ' selected="true"';
}
echo '>' . $opt . "</option>\n";
} // foreach material option
?>
</select><br>
<select name="finishing" class="finishing">
<option value="">--Please select finishing--</option>
<?
foreach($finishing_options as $key => $opt) {
echo ' <option value="' . $key . '"';
if ($_POST['finishing'] == $key) {
echo ' selected="true"';
}
echo '>' . $opt . "</option>\n";
} // foreach finishing option
?>
</select><br>
<input type="submit" name="submit" value="submit">
</form>