Ik heb een invoerformulier gemaakt welke de ingevoerde informatie via mail toe stuurt. Het hele formulier werkt en word verzonden máár.... zoals te zien, word er gebruik gemaakt van een paar checkboxen. Dez gven enkel de tekst "array"in de ontvangen email.
Hier onder betreffende htm formulier en post php
HTML
<form name="form1" method="post" action="post.php">
<br>
<table width="84%" border="0" align="center">
<tr>
<td width="32%">Naam: <br>
<input name="naam" type="text" value="">
<br>
</td>
<td colspan="2">E-mail: <br>
<input name="email" type="text" value=""></td>
</tr>
<tr>
<td colspan="3"><div align="center"><br>
<br>
<img src="/img/setup/line.jpg" width="500" height="5"></div>
</td>
</tr>
<tr>
<td colspan="3"><font color="#003333"><strong><br>
Vanaf hier kan je de vissen databasegegevens opgeven.<br>
</strong></font>SUCCES
en alvast bedankt namens alle aquarianen !<br>
<br>
Begin met aangeven van hoofdgroep en sub-groep</td>
</tr>
<tr>
<td><br>
<br>
<strong><font color="#003333" size="4">START</font></strong></td>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="3"><div align="center"><br>
<br>
<img src="/img/setup/line.jpg" width="500" height="5"></div></td>
</tr>
<tr>
<td colspan="3"><font color="#003333"><br>
<strong>Namen en herkomst</strong><br>
</font></td>
</tr>
<tr>
<td>Latijnse naam<br>
<input name="Latijnsenaam" type="text" id="Latijnsenaam">
</td>
<td width="32%">Nederlandse naam<br>
<input name="Nederlandsenaam" type="text" id="Nederlandsenaam"></td>
<td width="36%">Synoniemen<br>
<input name="Synoniemen" type="text" id="Synoniemen"></td>
</tr>
<tr>
<td colspan="3"><div align="center"><br>
</div>
</td>
</tr>
<tr>
<td>Familie<br>
<input name="Familie" type="text" id="Familie"></td>
<td>Herkomst<br>
<input name="Herkomst" type="text" id="Herkomst"></td>
<td> </td>
</tr>
<tr>
<td colspan="3"><div align="center"><br>
<br>
<img src="/img/setup/line.jpg" width="500" height="5"></div>
</td>
</tr>
<tr>
<td colspan="3"><font color="#003333"><br>
<strong>Leefgebied.</strong><br>
</font></td>
</tr>
<tr>
<td>Natuurlijke leefomgeving<br>
<textarea name="Leefomgeving" id="Leefomgeving"></textarea></td>
<td>Leef diepte
(<font color="#003333">vb; 1 tot 15mtr</font>)
<input name="Leefdiepte" type="text" id="Leefdiepte"></td>
<td> </td>
</tr>
<tr>
<td colspan="3"><div align="center"><br>
<br>
<img src="/img/setup/line.jpg" width="500" height="5"></div>
</td>
</tr>
<tr>
<td colspan="3"><font color="#003333"><br>
<strong>Voeding.</strong><br>
</font></td>
</tr>
<tr>
<td>Natuur<br>
<textarea name="Voedingnatuur" id="Voedingnatuur"></textarea>
</td>
<td>Aquarium<br>
<textarea name="Voedingaquarium" id="Voedingaquarium"></textarea></td>
<td> </td>
</tr>
<tr>
<td colspan="3"><div align="center"><br>
<br>
<img src="/img/setup/line.jpg" width="500" height="5"></div>
</td>
</tr>
<tr>
<td colspan="3"><font color="#003333"><br>
<strong>Voortbestaan.</strong><br>
</font></td>
</tr>
<tr>
<td>Geslacht verschillen<br>
<p>
<label>
<input type="radio" name="Geslachtverschillen" value="Ja">
Ja</label>
<br>
<label>
<input type="radio" name="Geslachtverschillen" value="Nee">
Nee</label>
<br>
</p></td>
<td>Jeugdkleed<br>
<p>
<label>
<input type="radio" name="Jeugdkleed" value="Ja">
Ja</label>
<br>
<label>
<input type="radio" name="Jeugdkleed" value="Nee">
Nee</label>
<br>
</p></td>
<td>Voortplanting<br>
<select name="Voortplanting" id="Voortplanting">
<option>Maak je keuze</option>
<option>Eierleggend</option>
<option>Eierleggend (substraatbroeder)</option>
<option>Eierleggend (vrijleggers)</option>
<option>Muilbroeder</option>
<option>Buidelbroeder</option>
<option>Onbekend</option>
<option>Weet ik niet</option>
</select></td>
</tr>
<tr>
<td colspan="3"><div align="center"><br>
<br>
<img src="/img/setup/line.jpg" width="500" height="5"></div>
</td>
</tr>
<tr>
<td colspan="3"><font color="#003333"><strong><br>
Karakter en gedragingen</strong></font><font color="#003333"><br>
</font></td>
</tr>
<tr>
<td>Leefwijze<br></td>
<td>Gedrag tv soortgenoten<br></td>
<td>Gedrag tov medbewoners</td>
</tr>
<tr>
<td><input name="Leefwijze[]" type="checkbox" id="Single" value="Single"><font color="#000000">Single</font><br>
<input name="Leefwijze[]" type="checkbox" id="Koppel" value="Koppel"><font color="#000000">Koppel</font><br>
<input name="Leefwijze[]" type="checkbox" id="Kleineschool" value="kleineschool"><font color="#000000">Kleine schooltjes</font><br>
<input name="Leefwijze[]" type="checkbox" id="groteschool" value="groteschool"><font color="#000000">Grote school</font></td>
<td><input name="Gedrag[]" type="checkbox" id="Vreedzaam2" value="Vreedzaam"><font color="#000000">Vreedzaam</font><br>
<input name="Gedrag[]" type="checkbox" id="Matig agressief" value="Matig agressief"><font color="#000000">Matig agressief</font><br>
<input name="Gedrag[]" type="checkbox" id="Agressief" value="Agressief"><font color="#000000">Agressief<br>
<input name="Gedrag[]" type="checkbox" id="Zeer agressief" value="Zeer agressief"> Zeer agressief </font></td>
<td><input name="Gedrag1[]" type="checkbox" id="Vreedzaam" value="Vreedzaam"><font color="#000000">Vreedzaam</font><br>
<input name="Gedrag1[]" type="checkbox" id="Matig agressief" value="Matig agressief"><font color="#000000">Matig agressief</font><br>
<input name="Gedrag1[]" type="checkbox" id="Agressief" value="Agressief"><font color="#000000">Agressief<br>
<input name="Gedrag1[]" type="checkbox" id="Zeer agressief" value="Zeer agressief">Zeer agressief </font></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Reef Safe<br>
<p>
<label>
<input type="radio" name="Reefsafe" value="Ja">
Ja</label>
<br>
<label>
<input type="radio" name="Reefsafe" value="Nee">
Nee</label>
<br>
</p></td>
<td>Giftig<br>
<p>
<label>
<input type="radio" name="Giftig" value="Ja">
Ja</label>
<br>
<label>
<input type="radio" name="Giftig" value="Nee">
Nee</label>
<br>
</p></td>
<td> </td>
</tr>
<tr>
<td colspan="3"><div align="center"><br>
<br>
<img src="/img/setup/line.jpg" width="500" height="5"></div>
</td>
</tr>
<tr>
<td colspan="3"><font color="#003333"><strong><br>
Houdbaarheid</strong></font><font color="#003333"> <em>(meerdere antwoorden mogelijk)</em><br>
</font></td>
</tr>
<tr>
<td height="30">Moeilijkheidsgraad<br>
</td>
<td colspan="2">Aquarium Formaat (exclusief bioloog)</td>
</tr>
<tr>
<td><input name="Houdbaarheid[]" type="checkbox" id="Zeer makkelijk" value="Zeer makkelijk"><font color="#000000">Zeer makkelijk</font><br>
<input name="Houdbaarheid[]" type="checkbox" id="Makkelijk" value="Makkelijk"><font color="#000000">Makkelijk</font><br>
<input name="Houdbaarheid[]" type="checkbox" id="Lastig" value="Lastig"><font color="#000000">Lastig</font><font color="#000000">er<br>
<input name="Houdbaarheid[]" type="checkbox" id="Zeer moeilijk" value="Zeer moeilijk">Zeer moeilijk</font></td>
<td colspan="2">
<input name="Formaat[]" type="checkbox" id="Nano aquarium" value="Nano aquarium"><font color="#000000">Nano Aquarium</font><br>
<input name="Formaat[]" type="checkbox" id="100ltr" value="100ltr"><font color="#000000">Vanaf 96 ltr</font> -- bv: 60x40x40cm<br>
<input name="Formaat[]" type="checkbox" id="200ltr" value="200ltr"><font color="#000000">Vanaf 200 ltr</font> -- bv: 80x50x50cm<br>
<input name="Formaat[]" type="checkbox" id="250ltr" value="250ltr"><font color="#000000">Vanaf 250 ltr</font> -- bv: 100x50x50cm<br>
<input name="Formaat[]" type="checkbox" id="325ltr" value="325ltr"><font color="#000000">Vanaf 325 ltr</font> -- bv: 130x50x50cm<br>
<input name="Formaat[]" type="checkbox" id="400ltr" value="400ltr"><font color="#000000">Vanaf 400 ltr</font> -- bv: 160x50x50cm -of- 140x50x60cm<br>
<input name="Formaat[]" type="checkbox" id="500ltr" value="500ltr"><font color="#000000">Vanaf 500 ltr</font> -- bv: 200x50x50cm - of - 160x50x60cm<br>
<input name="Formaat[]" type="checkbox" id="750ltr" value="750ltr"><font color="#000000">Vanaf 750 ltr</font> -- bv: 300x50x50cm - of - 200x60x60cm<br>
<input name="Formaat[]" type="checkbox" id="1000ltr" value="1000ltr"><font color="#000000">Vanaf 1000 ltr</font> -- bv: 400x50x50cm - of - 250x65x65cm<br>
<input name="Formaat[]" type="checkbox" id="2000ltr" value="2000ltr"><font color="#000000">2000 ltr of meer</font></td>
</tr>
<tr>
<td colspan="3"><div align="center"><br>
<br>
<img src="/img/setup/line.jpg" width="500" height="5"></div>
</td>
</tr>
<tr>
<td colspan="3"><font color="#003333"><strong><br>
Extra bijzonderheden</strong></font><font color="#003333"><br>
</font></td>
</tr>
<tr>
<td colspan="3"><textarea name="Bijzonderheden" cols="100" rows="10"></textarea></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<br>
<br>
<br><br>
<br>
<input type="submit" name="Submit" value="Verzenden">
</form>
PHP
<?php
if (!isset($_POST['naam']) || !isset($_POST['email']) || !isset($_POST['Latijnsenaam']) || !isset($_POST['Nederlandsenaam']) || !isset($_POST['Synoniemen']) || !isset($_POST['Familie'])
|| !isset($_POST['Herkomst']) || !isset($_POST['Leefomgeving']) || !isset($_POST['Leefdiepte']) || !isset($_POST['Voedingnatuur']) || !isset($_POST['Voedingaquarium']) || !isset($_POST['Geslachtverschillen'])
|| !isset($_POST['Jeugdkleed']) || !isset($_POST['Voortplanting']) || !isset($_POST['Leefwijze']) || !isset($_POST['Gedrag']) || !isset($_POST['Gedrag1']) || !isset($_POST['Reefsafe']) || !isset($_POST['Giftig'])
|| !isset($_POST['Houdbaarheid']) || !isset($_POST['Formaat']) || !isset($_POST['Bijzonderheden']))
{
echo 'U heeft niet alle velden ingevuld!';
exit;
}
$naam = htmlspecialchars($_POST['naam']);
$email = htmlspecialchars($_POST['email']);
$Latijnsenaam = htmlspecialchars($_POST['Latijnsenaam']);
$Nederlandsenaam = htmlspecialchars($_POST['Nederlandsenaam']);
$Synoniemen = htmlspecialchars($_POST['Synoniemen']);
$Familie = htmlspecialchars($_POST['Familie']);
$Herkomst = htmlspecialchars($_POST['Herkomst']);
$Leefomgeving = htmlspecialchars($_POST['Leefomgeving']);
$Leefdiepte = htmlspecialchars($_POST['Leefdiepte']);
$Voedingnatuur = htmlspecialchars($_POST['Voedingnatuur']);
$Voedingaquarium = htmlspecialchars($_POST['Voedingaquarium']);
$Geslachtverschillen = htmlspecialchars($_POST['Geslachtverschillen']);
$Jeugdkleed = htmlspecialchars($_POST['Jeugdkleed']);
$Voortplanting = htmlspecialchars($_POST['Voortplanting']);
$Leefwijze[] = htmlspecialchars($_POST['Leefwijze[]']);
$Gedrag[] = htmlspecialchars($_POST['Gedrag[]']);
$Gedrag1[] = htmlspecialchars($_POST['Gedrag1[]']);
$Reefsafe = htmlspecialchars($_POST['Reefsafe']);
$Giftig = htmlspecialchars($_POST['Giftig']);
$Houdbaarheid[] = htmlspecialchars($_POST['Houdbaarheid[]']);
$Formaat[] = htmlspecialchars($_POST['Formaat[]']);
$Bijzonderheden = htmlspecialchars($_POST['Bijzonderheden']);
$tijd = time();
$datum = strftime('%d/%m/%y %H:%M', $tijd);
$ip = getenv('REMOTE_ADDR');
$message = $naam.' met het e-mailadres '.$email.' en het IP '.$ip.' stuurde op '.$datum.' het volgende bericht:
____________________________________
BENAMINGEN
-------------------------------------------
Latijnse Naam: '.$Latijnsenaam.'
Nederlandse Naam: '.$Nederlandsenaam.'
Synoniemen: '.$Synoniemen.'
Familie: '.$Familie.'
LEVEN
--------------------------------------------
Herkomst: '.$Herkomst.'
Leefomgeving: '.$Leefomgeving.'
Leefdiepte: '.$Leefdiepte.'
VOEDING
----------------------------------------------
Voeding Natuur: '.$Voedingnatuur.'
Voeding Aquarium: '.$Voedingaquarium.'
GESLACHT / GEDRAG / KARAKTER / EIGENSCHAPPEN
------------------------------------------------
Geslacht verschillen: '.$Geslachtverschillen.'
Jeugdkleed: '.$Jeugdkleed.'
Leefwijze: '.$Leefwijze.'
Gedrag tov Soortgenoten: '.$Gedrag.'
Gedrag tov medebewoners: '.$Gedrag1.'
Reefsafe: '.$Reefsafe.'
Giftig: '.$Giftig.'
Houdbaarheid: '.$Houdbaarheid.'
Minimale aquariummaat: '.$Formaat.'
Extra Bijzonderheden: '.$Bijzonderheden.'
------------------------------------';
mail('[email protected]', 'Nieuwe inbreng voor xxxxxxx database', $message, 'From: '.$email);
echo 'Uw bericht is verzonden. Ontzettend BEDANKT voor uw bijdrage !.';
?>
PS; ik hoop dat ik de juiste code gebruik voor een duidelijke weergave ;)