hi can anybody help me with this code please
switch ($department)
{
case 1
$email = 'xxx@xxxxxx.co.uk';
break;
case 2
$email = 'xxx@xxxxxx.co.uk';
break;
case 3
$email = 'xxx@xxxxxx.co.uk';
break;
case 4
$email = 'xxx@xxxxxx.co.uk';
break;
case 5
$email = 'xxx@xxxxxx.co.uk';
break;
}
...html code in between
<?
$department = array(
1 => "Web Design (Ryan Norton)",
2 => "Multimedia (Joe Groves)",
3 => "Photography (Oliver Brayford)",
4 => "Scripting (Andrew Siddle)",
5 => "Logo Design (Andrew Figg)",
);
$department = str_replace(" ", " ", $department);
echo '<select name=department>';
foreach($department as $key => $value)
{
echo '<option value='.$value.'> '.$value.'';
}
echo '</select>';
?>
this is ment to be a dropdown list and displays the names which i got working (the second section) then the code to set the email address(the first section) but when i run the code i get the error
Parse error: parse error, unexpected T_VARIABLE in /home/asiddle4/public_html/contactform.php on line 158
which is this line
157 case 1
158 $email = 'xxx@xxxxxx.co.uk';
159 break;
can anyone help me please
thanks
switch ($department)
{
case 1
$email = 'xxx@xxxxxx.co.uk';
break;
case 2
$email = 'xxx@xxxxxx.co.uk';
break;
case 3
$email = 'xxx@xxxxxx.co.uk';
break;
case 4
$email = 'xxx@xxxxxx.co.uk';
break;
case 5
$email = 'xxx@xxxxxx.co.uk';
break;
}
...html code in between
<?
$department = array(
1 => "Web Design (Ryan Norton)",
2 => "Multimedia (Joe Groves)",
3 => "Photography (Oliver Brayford)",
4 => "Scripting (Andrew Siddle)",
5 => "Logo Design (Andrew Figg)",
);
$department = str_replace(" ", " ", $department);
echo '<select name=department>';
foreach($department as $key => $value)
{
echo '<option value='.$value.'> '.$value.'';
}
echo '</select>';
?>
this is ment to be a dropdown list and displays the names which i got working (the second section) then the code to set the email address(the first section) but when i run the code i get the error
Parse error: parse error, unexpected T_VARIABLE in /home/asiddle4/public_html/contactform.php on line 158
which is this line
157 case 1
158 $email = 'xxx@xxxxxx.co.uk';
159 break;
can anyone help me please
thanks
