mail.php help

I am trying to create a simple contact form using mail.php and a list/menu with multiple values. I can only get the form to send me an email with the last value selected, OR I can get it to send me an email stating “Array” no matter what I select. Here is my code for that section of the form:

Services You Are
Interested In: -- Please Select -- Web Development Hosting Maintenance Optimization Domain Registration Other

Any help would be greatly appreciated!

You’re probably not unraveling your array in the PHP script you’re using. You’re going to have to state every element of the array separately in the message of your email.

Thank you, this helps a little, but unfortunately I am relatively new to PHP and don’t know how to do that. Help would be appreciated. Thanks!

foreach() should get you on your way with discerning the different elements of your array. It’s also possible to just call the array element directly by its key:

$myElement = $myArray['myArrayKey'];.

Sponsor our Newsletter | Privacy Policy | Terms of Service