TjallingBC
Gebruiker
- Lid geworden
- 4 sep 2008
- Berichten
- 15
Beste mensen, ik zit met een probleempje. Ik probeer een contact/bestelformuliertje in elkaar te flansen, maar het lukt me maar niet. Ik gebruik een pre-made script en heb dat aangepast (de comments in de code en zelfs de meeste variabelen zijn dus niet van mij; de spelfouten had ik al opgemerkt
).
Waarschijnlijk is de code in de ogen van een professional erg rommelig en ongetwijfeld niet conform welke acceptabele norm dan ook, maar goed. Ik wil gewoon dat het werkt!
Als ik hem upload dan laat Firefox alleen een witte pagina zien en IE geeft een 500 error code..
Hier komt hij dan! Ziet iemand wat er fout gaat?

Waarschijnlijk is de code in de ogen van een professional erg rommelig en ongetwijfeld niet conform welke acceptabele norm dan ook, maar goed. Ik wil gewoon dat het werkt!
Als ik hem upload dan laat Firefox alleen een witte pagina zien en IE geeft een 500 error code..
Hier komt hij dan! Ziet iemand wat er fout gaat?
PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>*** bestelformulier</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
*{
font-family: verdana;
font-size: 10px;
}
.td {
border-top: solid black 1px;
border-bottom: solid black 1px;
border-left: solid black 1px;
border-right: solid black 1px;
background: #F3F3F3
}
.td2 {
border-top: solid black 0px;
border-bottom: solid black 0px;
border-left: solid black 1px;
border-right: solid black 1px;
background: #F3F3F3
}
.red {
color: FF0000;
}
.green {
color: #66CC33;
}
.grey{
color: #CCCCCC;
}
input {
color: #333333;
background: #F3F3F3;
border: solid #CCCCCC 1px;
}
select {
color: #333333;
background: #F3F3F3;
border: solid #CCCCCC 1px;
}
textarea {
color: #333333;
background: #F3F3F3;
border: solid #CCCCCC 1px;
background-image: url('images/achtergrond.jpg');
background-repeat: no-repeat;
background-position: center center;
}
a {
text-decoration: none;
text-transform: underline;
color: #999999;
}
a:hover {
filter: none;
height: 1px; -->
text-decoration: none;
text-transform: none;
color: #333333; <!-- #FCC812 : oranje -->
}
body {
background: #f0f3f2;
}
body, iframe, select, textarea {
scrollbar-face-color: #f3f3f3;
scrollbar-highlight-color: #CCCCCC;
scrollbar-shadow-color: #f2f2f2;
scrollbar-3dlight-color: white;
scrollbar-arrow-color: #f2f2f2;
scrollbar-track-color: white;
scrollbar-darkshadow-color: white;
scrollbar-base-color: white;
}
</style>
</head>
<body>
<?php
//je gegevens hieronder invullen
$jeemailadresse = "*"; //je email adresse ==> email adress
$shortsitename= "*";
$jesite = "*" ;//je site naam ==> site url
$copyright = true ; //copyright true/false = aan/uit
//hier onder niks mer veranderen
//deze codes hieronder kijken als er vreemde tekens voorkomen in de naam en in de e-mail adresse speciala tekens zijn niet toegelaten
function valid_mail($str) {
return (ereg ('(^[0-9a-zA-Z_\.-]{1,}@([0-9a-zA-Z_\-]{1,}\.)+[0-9a-zA-Z_\-]{2,}$)', $str));
}
function valid_name ($str) {
return (ereg ('^[A-Za-z. -]+$', $str));
}
// dus als het formulier leeg is of een van de waarden niet in ingevuld
$voornaam = ucfirst($voornaam);
if ($_POST['verzendknop'] != "Verzenden" || !valid_name($_POST['voornaam']) || !isset($_POST['achternaam']) || !isset($_POST['huisnr']) || !isset($_POST['woonplaats']) || !valid_name($_POST['postcode']) || !valid_mail($_POST['mailadres'])) {
?>
<form method="post" action="bestellen.php">
<table width="407" border="0" cellpadding="0" cellspacing="0" bgcolor="#F0F3F2">
<tr align="center" bgcolor="#F0F3F2">
<td height="27" colspan="2" valign="middle"><p><font color="#999999">Bestelformulier</font></p>
<p> N.B.: Velden gemarkeerd met een * moeten ingevuld worden!</p></td>
</tr>
<tr>
<td width="22%" valign="middle" style="height: 26px" >
<font color="#0471E1"> Voornaam : </font></td>
<td width="78%" style="height: 26px" >
<input type="text" name="voornaam" style="width: 304px">*</td>
</tr>
<tr>
<td width="22%" valign="middle" style="height: 26px" >
<font color="#0471E1"> Achternaam : </font></td>
<td width="78%" style="height: 26px" >
<input type="text" name="achternaam" style="width: 304px">*</td>
</tr>
<tr>
<td width="22%" valign="middle" style="height: 26px" >
<font color="#0471E1"> E-mail : </font></td>
<td width="78%" style="height: 26px" ><input type="text" name="mailadres" style="width: 304px">*
</td>
</tr>
<tr>
<td width="22%" style="height: 26px" ><font color="#0471E1"> Product : </font></td>
<td width="78%" valign="middle" style="height: 26px" >
<select name="product" id="product">
<option value="cognitie">Cognitie Mixtape</option>
</select>
*</td>
</tr>
<tr>
<td width="22%" style="height: 26px" ><font color="#0471E1"> Aantal : </font></td>
<td width="78%" valign="middle" style="height: 26px" >
<select name="aantal" id="aantal">
<option value="1">1 (€ 10,-)</option>
<option value="2">2 (€ 20,-)</option>
<option value="3">3 (€ 30,-)</option>
<option value="4">4 (€ 40,-)</option>
<option value="5">5 (€ 50,-)</option>
<option value="meer - neem contact op met de afzender">meer</option>
</select>
*</td>
</tr>
<tr>
<td width="22%" valign="middle" style="height: 26px" >
<font color="#0471E1"> Straat : </font></td>
<td width="78%" style="height: 26px" >
<input type="text" name="straat" style="width: 175px">*
<font color="#0471E1">Huisnummer :</font>
<input type="text" name="huisnummer" style="width: 33px">* </td>
<tr>
<td width="22%" valign="middle" style="height: 26px" >
<font color="#0471E1"> Postcode : </font></td>
<td width="78%" style="height: 26px" >
<input name="postcode" type="text" style="width: 60px" maxlength="6">*
<font color="#0471E1">Woonplaats :</font>
<input type="text" name="woonplaats" style="width: 153px">*
</td>
</tr>
<tr>
<td valign="top"><p><br>
<font color="#0471E1">Evt. opmerkingen : </font></p>
</td>
<td> <br>
<textarea rows="10" name="reactie" style="width: 304px" cols="20"></textarea>
<br>
</td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input name="reset" type="reset" value="Reset">
<input type="submit" value="Verzenden" name="verzendknop">
</div><br></td>
</tr>
<tr>
<td height="27" colspan="2" valign="middle" >
<div align="center">
<?php
//copyright code
if ($copyright == false )
{
echo "<font color=\"#999999\" size=\"2\">© 2009 <a href=\"".$jesite."\" target=\"_blanks\">".$shortsitename."</a> - Alle rechten voorbehouden />";
}
?>
</div></td>
</tr>
</table>
</form>
<?php
}
else { //dit word gedaan als alle velden juist zijn ingevuld.
$bericht1 = "Er is via het bestelformulier op *.nl een nieuwe bestelling verzonden: \n\n\n
Voornaam : ".$_POST['voornaam']." \n
Achternaam : ".$_POST['achternaam']" \n
E-mail : ".$_POST['mailadres']." \n\n
Product : ".$_POST['product']." \n\n
Adresgegevens : \n
Straat + huisnr. : : ".$_POST['straat']." ".$_POST['huisnummer']." \n
Postcode + woonpl.: : ".$_POST['postcode']." ".$_POST['woonplaats']." \n\n
De bestelling is afkomstig van het volgende IP-adres: ".$_SERVER['REMOTE_ADDR']." ";
$bericht2 = "Bedankt voor je bestelling, ".$_POST['voornaam']."! Je kunt binnenkort een e-mail met de betaalgegevens van ons verwachten! \n\n\n
Hieronder staat nogmaals je bestelling: \n\n
Voornaam : ".$_POST['voornaam']." \n
Achternaam : ".$_POST['achternaam']" \n
E-mail : ".$_POST['mailadres']." \n\n
Product : ".$_POST['product']." \n\n
Adresgegevens : \n
Straat + huisnr. : : ".$_POST['straat']." ".$_POST['huisnummer']." \n
Postcode + woonpl.: : ".$_POST['postcode']." ".$_POST['woonplaats']." ";
mail($jeemailadresse, 'Een nieuwe bestelling voor: '$_POST['product'], $bericht1, "From: $_POST[mailadres]");
mail($_POST['mailadres'], 'Bedankt voor je bestelling voor de '$_POST['product'], $bericht2,"From: $_POST[mailadres]");
echo "Je bestelling is verzonden! Je kunt binnenkort een bevestiging van ons verwachten!";
}
?>
</body>
</html>
Laatst bewerkt: