Dankjewel voor je reactie! Ik zal niet alles neerzetten, want er is heel veel html ook, maar hier (hopelijk) relevante code:
<?php
$arrErrors = array();
//Alleen valideren bij submit
if (!empty($_POST['Submit'])) {
if ($_POST['Discipline']=='')
$arrErrors['Discipline'] = 'Vul alstublieft uw discipline in.';
if ($_POST['Naam_verwijzer']=='')
$arrErrors['Naam_verwijzer'] = 'Vul alstublieft uw naam in.';
if ($_POST['Email_verwijzer']=='')
$arrErrors['Email_verwijzer'] = 'Vul alstublieft uw e-mailadres in.';
if ($_POST['Tel_verwijzer']=='')
$arrErrors['Tel_verwijzer'] = 'Vul alstublieft uw telefoonnummer in.';
if ($_POST['Naam_patient']=='')
$arrErrors['Naam_patient'] = 'Vul alstublieft de naam van de patiënt in.';
if ($_POST['Email_patient']=='')
$arrErrors['Email_patient'] = 'Vul alstublieft het e-mailadres van de patient in.';
if ($_POST['BSN']=='')
$arrErrors['BSN'] = 'Vul alstublieft het BSN-nummer van de patient in.';
if ($_POST['Tel_patient']=='')
$arrErrors['Tel_patient'] = 'Vul alstublieft het telefoonnummer van de patient in.';
$email;$comment;$captcha;
if(isset($_POST['post'])){
$email=$_POST['post'];
}if(isset($_POST['comment'])){
$email=$_POST['comment'];
}if(isset($_POST['g-recaptcha-response'])){
$captcha=$_POST['g-recaptcha-response'];
}
if(!$captcha)$arrErrors['captcha'] = 'Vink alstublieft de captcha aan.';
$secretKey = "6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe";
$ip = $_SERVER['REMOTE_ADDR'];
$response=file_get_contents("https://
www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$captcha."&remoteip=".$ip);
$responseKeys = json_decode($response,true);
if (count($arrErrors) == 0) {
$Discipline = $_POST['Discipline'];
$Naam_verwijzer = $_POST['Naam_verwijzer'];
$Email_verwijzer = $_POST['Email_verwijzer'];
$Tel_verwijzer = $_POST['Tel_verwijzer'];
$Naam_patient = $_POST['Naam_patient'];
$Email_patient = $_POST['Email_patient'];
$Tel_patient = $_POST['Tel_patient'];
$BSN = $_POST['BSN'];
$Parodontaal = $_POST['Parodontaal']; //select
$Paro_anders = $_POST['Paro_anders'];//textarea
$Extracties = $_POST['Extracties']; //ja-nee radiobutton
$Elementen = $_POST['Elementen'];//textarea
$Voorbehandeld = $_POST['Voorbehandeld'];//ja-nee radiobutton
$Voorbehandeling = $_POST['Voorbehandeling'];//select
$Nazorg = $_POST['Nazorg'];//textarea
$Premedicatie = $_POST['Premedicatie'];//ja-nee radiobutton
$Antibioticum = $_POST['Antibioticum'];//welk antibioticum
$Nazorg_doorwie = $_POST['Nazorg_doorwie'];//ja-nee radiobutton
$Implantologisch = $_POST['Implantologisch'];//select
$Impl_anders = $_POST['Impl_anders'];//textarea
$Suprastructuur = $_POST['Suprastructuur'];//ja-nee radiobutton
$Cosmetisch = $_POST['Cosmetisch'];//select
$Cosm_anders = $_POST['Impl_anders'];//textarea
$Planning = $_POST['Planning'];//textarea
$files = $_POST['files'];//uploads
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; multipart/alternative;charset=iso-8859-1' . "\r\n";
$headers .= "From: Verwijzing parodontoloog <
[email protected]>" . "\r\n";
$to = "
[email protected]"; //waarnaartoe
$subject = "Verwijzing van $Discipline voor de parodontoloog";
$attachment = "chunk_split(base64_encode(file_get_contents('attachment.zip')))";
$styletag = "style=\"font-weight:bold;border-top: 2px solid #ff8800; line-height: 150%;\"">
$message = "
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"
\"http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html>
<head>
<title>Verwijzing verzonden</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
</head>
<body>
<span style=\"font-family:sans-serif;\">invuldatum: ".date("d-m-Y H:i")."</span>
<br><br>
<table style=\"font-family:sans-serif; line-height: 170%; background-color: #f4f4f4; border-collapse: collapse; width:100%; margin: 30px 0\">
<tr>
<td style=\"font-weight:bold;width:30%;border-top: 2px solid #ff6600\">Discipline:</td>
<td style=\"border-top: 2px solid #ff6600\">$Discipline</td></tr>
<tr><td style=\"font-weight:bold;\">Naam verwijzer:</td>
<td>$Naam_verwijzer</td></tr>
<tr>
<td style=\"font-weight:bold;\">E-mail verwijzer:</td>
<td>$Email_verwijzer</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">Telefoon verwijzer:</td>
<td>$Tel_verwijzer</td>
</tr>
<tr>
<td style=\"font-weight:bold; border-top: 2px solid #ff6600\">Naam patiënt:</td>
<td style=\"border-top: 2px solid #ff6600\">$Naam_patient</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">E-mail patiënt:</td>
<td>$Email_patient</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">Telefoon patiënt:</td>
<td>$Tel_patient</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">BSN:</td>
<td>$BSN</td>
</tr>
<tr>
<td style=\"font-weight:bold; border-top: 2px solid #ff6600\">PARODONTAAL:</td>
<td style=\"border-top: 2px solid #ff6600\">$Parodontaal</td>
</tr>
<tr>
<td style=\"font-weight:bold\">Anders, nl:</td>
<td>$Paro_anders</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">Extracties:</td>
<td>$Extracties</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">Elementen:</td>
<td>$Elementen</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">Voorbehandeld:</td>
<td>$Voorbehandeld</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">Voorbehandeling:</td>
<td>$Voorbehandeling</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">Nazorg:</td>
<td>$Nazorg</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">Premedicatie:</td>
<td>$Premedicatie</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">Antibioticum:</td>
<td>$Antibioticum</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">Nazorg door wie:</td>
<td>$Nazorg_doorwie</td>
</tr>
<tr>
<td style=\"font-weight:bold;border-top: 2px solid #ff8800\"\">IMPLANTOLOGISCH:</td>
<td style=\"border-top: 2px solid #ff8800\">$Implantologisch</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">Anders, nl:</td>
<td>$Impl_anders</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">Suprastructuur:</td>
<td>$Suprastructuur</td>
</tr>
<tr>
<td style=\"font-weight:bold;border-top: 2px solid #ff8800\">COSMETISCH:</td>
<td style=\"border-top: 2px solid #ff8800\">$Cosmetisch</td>
</tr>
<tr>
<tr>
<td style=\"font-weight:bold\">Anders, nl:</td>
<td>$Cosm_anders</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">Restauratieve planning:</td>
<td>$Planning</td>
</tr>
<tr>
<td style=\"font-weight:bold;\">Bijlages:</td>
<td>$files</td>
</tr>
</table>
</body>
</html>
";
mail($to, $subject, $message, $headers);
mail($Email_verwijzer,"Verwijzing parodontoloog ontvangen","
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html>
<head>
<title>E-mail verzonden</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
</head>
<body>
<p>Beste $Naam_verwijzer,</p>
<p>Uw verwijzing is in goede orde ontvangen.</p>
<p>Onze praktijk neemt spoedig contact op met de patiënt om een afspraak te maken. Na het eerste onderzoek ontvangt u een uitgebreid consultverslag van de parodontiumstatus en de daarbij gemaakte röntgenfoto's per email of per post.</p>
<p>Met vriendelijke groet,</p>
<p>Laura Ziukaite, parodontoloog,<br>
Tandarts aan het IJ
</p>
</body>
</html>
"
,$headers);
header("Location: bedankt.php");
} else {
// error string initaliseren
$strError = '<div class="formerror"><p>Controleer alstublieft de volgende velden en probeer opnieuw:</p><ul>';
// alle errors toevoegen
foreach ($arrErrors as $error) {
$strError .= "<li>$error</li>";
}
// error string afsluiten
$strError .= '</ul></div>';
}
}
?>
<?php
/**
* Multi file upload example
* @author Resalat Haque
* @link
http://www.w3bees.com/2013/02/multiple-file-upload-with-php.html
**/
$valid_formats = array("jpg", "png", "gif", "zip");
$max_file_size = 1024*1000; //1000 kb
$path = "uploads/"; // Upload directory
$count = 0;
$your_email = '
[email protected]';//<<-- update this to your email address
// explode all lines
if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST"){
// Loop $_FILES to execute all files
foreach ($_FILES['files']['name'] as $f => $name) {
if ($_FILES['files']['error'][$f] == 4) {
continue; // Skip file if any error found
}
if ($_FILES['files']['error'][$f] == 0) {
if ($_FILES['files']['size'][$f] > $max_file_size) {
$message[] = "$name is te groot!.";
continue; // Skip large files
}
elseif( ! in_array(pathinfo($name, PATHINFO_EXTENSION), $valid_formats) ){
$message[] = "$name is geen geldig formaat";
continue; // Skip invalid file formats
}
else{ // No error found! Move uploaded files
$ext = pathinfo($_FILES['files']['name'][$f], PATHINFO_EXTENSION);
$uniq_name = uniqid() . '.' .$ext;
if(move_uploaded_file($_FILES["files"]["tmp_name"][$f], $path.$uniq_name)) {
$count++; // Number of successfully uploaded files
$from = $your_email;
}
}
}
}
}
?>
en hier het form element:
<form action="#verwijzen" method="post" enctype="multipart/form-data">
Dat laaste werkt geweldig, alleen wat ik al zei, het komt keurig aan i het mapje maar hoe je dit in de mail krijgt...
Kan jij iets hiermee...?
Groetjes, Mary
[size=xsmall]
Toevoeging op 31/05/2016 18:30:49:[/size]
ja, die google recaptcha key is nog de test key ;-)