Form with Checkboxes

the mail() function

Moderators: egami, macek, gesf

Post Reply
User avatar
php-forum GURU
php-forum GURU
Posts: 2192
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Mon Dec 12, 2011 6:19 am

$ServicesRequired = ''; // set a blank var, otherwise the log file throws an error..

foreach($_POST['ServicesRequired'] as $key => $value) {
$ServicesRequired .= $value."\r\n<br>";

There is no need to do any checking on this variable really, since it's already hard coded.
Or, simply check to make sure that at least one service was checked..

if ($ServicesRequired == '') {
throw your error here..

Post Reply