I have a simple form mail script using "mail("example")". everything is working except for the select box. When the form is submitted everything seems to be ok, no errors. When I recieve the mail I get "Array" where the information from the select box should be. Can anyone help me here?
Are you using something like this ?
<SELECT NAME=select_box[]>
and then referencing the variable like this ?
echo $select_box;
or ...
echo $_POST['select_box']
If so, try referencing your variable like this ...
echo $_POST['select_box'][0];
I am using... <? $to="user@address"; $select_box=$_POST['select_box']; $message="$email\n$select_box\n"; if(mail($to,"subject",$message,"From:$email\n")){ echo"message was sent"; }else{ echo"there was a problem sending message"; } ?>
your code is bad
you had "$select_box=$POST[select_box']; " should be "$select_box=$POST['select_box']; "
iceraider
It is like that I just typed it wrong.
I figured this one out, thanks for the help!
I used this code to fix it...
<? $to="user@address"; $select_box=$_POST['select_box']; $count=count($select_box); for ($i=0; $i<$count; $i++){ $content_select_box=$select_box[$i]; } $message="$email\n$content_select_box\n"; if(mail($to,"subject",$message,"From:$email\n")){ echo"message was sent"; }else{ echo"there was a problem sending message"; } ?>