'naam',"type"=>'t','verplicht'=>'1'), array("veld"=>'emailadres',"type"=>'t','verplicht'=>'1'), array("veld"=>'vissen',"type"=>'a','verplicht'=>'1'), array("veld"=>'inrichting',"type"=>'a','verplicht'=>'1'), array("veld"=>'techniek',"type"=>'a','verplicht'=>'1'), array("veld"=>'beschrijving',"type"=>'a','verplicht'=>'1'), array("veld"=>'foto (selecteer foto)',"type"=>'f','verplicht'=>'0') ); //print_r($_POST); if (isset($_POST) && key_exists($aVelden[0]['veld'],$_POST)) { $emailMsg = ""; foreach ($aVelden as $k => $v) { // email adres from if (ereg("email",$v['veld']) && key_exists($v['veld'],$_POST) && trim($_POST[$v['veld']])!="") { define("_EMAILADRES_FROM",$_POST[$v['veld']]); } if (key_exists($v['veld'],$_POST) && (trim($_POST[$v['veld']])=="") && $v['verplicht']==1) { $msg = "Graag alle velden invullen"; } else if (key_exists($v['veld'],$_POST) && $v['type']!="f") { $values[$v['veld']] = trim($_POST[$v['veld']]); $emailMsg .= $v['veld'].": ". $_POST[$v['veld']]."\n"; } } // geen foutmelding verstuur formulier if ($msg=="") { $mail = new sendAttachments(); $mail->email_to = _EMAILADRES_ONTVANGER; $mail->email_from = _EMAILADRES_FROM; $mail->email_subject = _EMAIL_SUBJECT; $mail->email_msg = $emailMsg; if ($mail->checkSize()) { $mail->uploadFile(); $mail->SendIt(); if ($mail->uploadFile()) { $msg = _MELDING_VERSTUURD; } else { $msg = _MELDING_FOUT_BIJ_VERSTUREN; } } else { $msg = _FILE_TE_GROOT; } } } //maak formulier include('header.php'); if ($msg!="") { echo $msg; } maakFormulier($aVelden, $parameters,$values); include('footer.php'); ?>