Hulp gevraagd, m'n Contactformulier geeft error
Antony - 14/09/2008 06:01
Nieuw lid
Hallo Mensen met Antony,
Ik zit met het volgende probleem, het contactformulier op mijn website:
http://www.pcqualitybonte.nl/contactinfo.php geeft steeds mijn error pagina weer als ik het
formulier (ingevuld) probeer te verzenden.
Ik ben hier de afgelopen week al mee bezig en ik zie niet waar de fout zit, kan iemand mij misschien helpen
om dit contactformulier weer werkend te maken, ik moet hem maandag af hebben en zit er dus nogal om verlegen
Met vriendelijke groet, Antony Bonte.
Hieronder post ik even mailform code en het de code uit het php bestandje: "mailer.php"
HET CONTACTFORMULIER CODE:
<table width="178" height="142" border="0">
<tr>
<td colspan="2"><p> </p>
<p class="kop3">Contact Formulier</p></td>
</tr>
<tr>
<td> </td>
<td><div align="left">
<form action="http://www.pcqualitybonte.nl/mail/mailer.php" method="post" name="form1" target="_blank" id="form1" onSubmit="MM_validateForm('voornaam','','R','achternaam','','R','straat','','R','postcode','','RisNum','postcode_nr','','R','plaats','','R','telefoon','','RisNum','email','','RisEmail');return document.MM_returnValue">
<div align="left">
<p> </p>
<table width="383" border="0" cellspacing="0" cellpadding="0">
<tr class="plaintekst">
<td height="24" colspan="3"> U wilt graag:</td>
</tr>
<tr align="left" valign="top" class="plaintekst">
<td colspan="3"><table width="383" border="0" cellspacing="0" cellpadding="0">
<tr class="plaintekst">
<td width="37" height="16"><input name="offerte" type="checkbox" id="offerte" value="OFFERTE" /></td>
<td width="346">Een vrijblijvende offerte aanvragen.</td>
</tr>
<tr class="plaintekst">
<td height="15"><input name="informatie" type="checkbox" id="informatie" value="INFORMATIE" /></td>
<td>Meer informatie over tarieven etc.</td>
</tr>
<tr class="plaintekst">
<td height="16"><input name="afspraak" type="checkbox" id="afspraak" value="AFSPRAAK" /></td>
<td>Afspraak maken.</td>
</tr>
<tr class="plaintekst">
<td height="16"><input name="contact_opnemen" type="checkbox" id="contact_opnemen" value="CONTACT" /></td>
<td>Dat er contact met mij wordt opgenomen.</td>
</tr>
</table></td>
</tr>
<tr class="plaintekst">
<td height="15" colspan="3" align="left" valign="middle"> </td>
</tr>
<tr class="plaintekst">
<td height="18">Voornaam</td>
<td height="18" colspan="2"><input name="voornaam" type="text" id="voornaam" size="25" /></td>
</tr>
<tr class="plaintekst">
<td width="81" height="18">Achternaam</td>
<td height="18" colspan="2"> <input name="achternaam" type="text" id="achternaam" size="25" />
</td>
</tr>
<tr class="plaintekst">
<td>Straat</td>
<td colspan="2"><input name="straat" type="text" id="straat" size="25" /></td>
</tr>
<tr class="plaintekst">
<td>Postcode</td>
<td colspan="2"><input name="postcode" type="text" id="postcode" size="4" maxlength="4" />
<input name="postcode_nr" type="text" id="postcode_nr" size="2" maxlength="2" />
</td>
</tr>
<tr class="plaintekst">
<td>Plaats</td>
<td colspan="2"><input name="plaats" type="text" id="plaats" size="25" /></td>
</tr>
<tr class="plaintekst">
<td>Telefoonnr.</td>
<td colspan="2"><input name="telefoon" type="text" id="telefoon" size="25" /></td>
</tr>
<tr class="plaintekst">
<td>Email</td>
<td colspan="2"><input name="email" type="text" id="email" size="25" /></td>
</tr>
<tr class="plaintekst">
<td valign="top">opmerkingen:</td>
<td colspan="2"><textarea name="opmerkingen" cols="25" id="opmerkingen"></textarea></td>
</tr>
<tr class="plaintekst">
<td> </td>
<td width="52" rowspan="2"> </td>
<td width="250" rowspan="2"><input type="submit" name="Submit" value="Versturen" />
<input type="reset" name="Submit2" value="wissen" />
</td>
</tr>
<tr class="plaintekst">
<td> </td>
</tr>
</table>
</div>
</form>
</div></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<p> </p>
<p><img src="images/Plattegrond_kl.jpg" width="409" height="346"></p>
</div>
</p>
<p> </p><p><script language="JavaScript" type="text/javascript">
<!-- Begin
if (window.print) {
document.write('<form> '
+ '<input type=button name=print value="Print Pagina" '
+ 'onClick="javascript:window.print()"></form>');
}
// End -->
</script></p></td>
</tr>
</table>
< table width= "178" height= "142" border= "0" >
< tr>
< td colspan= "2" >< p>& nbsp;</ p>
< p class = "kop3" > Contact Formulier</ p></ td>
</ tr>
< tr>
< td>& nbsp;</ td>
< td>< div align= "left" >
< form action= "http://www.pcqualitybonte.nl/mail/mailer.php" method= "post" name= "form1" target= "_blank" id= "form1" onSubmit= "MM_validateForm('voornaam','','R','achternaam','','R','straat','','R','postcode','','RisNum','postcode_nr','','R','plaats','','R','telefoon','','RisNum','email','','RisEmail');return document.MM_returnValue" >
< div align= "left" >
< p>& nbsp;</ p>
< table width= "383" border= "0" cellspacing= "0" cellpadding= "0" >
< tr class = "plaintekst" >
< td height= "24" colspan= "3" >& nbsp; U wilt graag:</ td>
</ tr>
< tr align= "left" valign= "top" class = "plaintekst" >
< td colspan= "3" >< table width= "383" border= "0" cellspacing= "0" cellpadding= "0" >
< tr class = "plaintekst" >
< td width= "37" height= "16" >< input name= "offerte" type= "checkbox" id= "offerte" value= "OFFERTE" /></ td>
< td width= "346" > Een vrijblijvende offerte aanvragen.</ td>
</ tr>
< tr class = "plaintekst" >
< td height= "15" >< input name= "informatie" type= "checkbox" id= "informatie" value= "INFORMATIE" /></ td>
< td> Meer informatie over tarieven etc.</ td>
</ tr>
< tr class = "plaintekst" >
< td height= "16" >< input name= "afspraak" type= "checkbox" id= "afspraak" value= "AFSPRAAK" /></ td>
< td> Afspraak maken.</ td>
</ tr>
< tr class = "plaintekst" >
< td height= "16" >< input name= "contact_opnemen" type= "checkbox" id= "contact_opnemen" value= "CONTACT" /></ td>
< td> Dat er contact met mij wordt opgenomen.</ td>
</ tr>
</ table></ td>
</ tr>
< tr class = "plaintekst" >
< td height= "15" colspan= "3" align= "left" valign= "middle" >& nbsp;</ td>
</ tr>
< tr class = "plaintekst" >
< td height= "18" > Voornaam</ td>
< td height= "18" colspan= "2" >< input name= "voornaam" type= "text" id= "voornaam" size= "25" /></ td>
</ tr>
< tr class = "plaintekst" >
< td width= "81" height= "18" > Achternaam</ td>
< td height= "18" colspan= "2" > < input name= "achternaam" type= "text" id= "achternaam" size= "25" />
</ td>
</ tr>
< tr class = "plaintekst" >
< td> Straat</ td>
< td colspan= "2" >< input name= "straat" type= "text" id= "straat" size= "25" /></ td>
</ tr>
< tr class = "plaintekst" >
< td> Postcode</ td>
< td colspan= "2" >< input name= "postcode" type= "text" id= "postcode" size= "4" maxlength= "4" />
< input name= "postcode_nr" type= "text" id= "postcode_nr" size= "2" maxlength= "2" />
</ td>
</ tr>
< tr class = "plaintekst" >
< td> Plaats</ td>
< td colspan= "2" >< input name= "plaats" type= "text" id= "plaats" size= "25" /></ td>
</ tr>
< tr class = "plaintekst" >
< td> Telefoonnr.</ td>
< td colspan= "2" >< input name= "telefoon" type= "text" id= "telefoon" size= "25" /></ td>
</ tr>
< tr class = "plaintekst" >
< td> Email</ td>
< td colspan= "2" >< input name= "email" type= "text" id= "email" size= "25" /></ td>
</ tr>
< tr class = "plaintekst" >
< td valign= "top" > opmerkingen:</ td>
< td colspan= "2" >< textarea name= "opmerkingen" cols= "25" id= "opmerkingen" ></ textarea></ td>
</ tr>
< tr class = "plaintekst" >
< td>& nbsp;</ td>
< td width= "52" rowspan= "2" >& nbsp;</ td>
< td width= "250" rowspan= "2" >< input type= "submit" name= "Submit" value= "Versturen" />
< input type= "reset" name= "Submit2" value= "wissen" />
</ td>
</ tr>
< tr class = "plaintekst" >
< td>& nbsp;</ td>
</ tr>
</ table>
</ div>
</ form>
</ div></ td>
</ tr>
< tr>
< td colspan= "2" >< div align= "center" >
< p>& nbsp;</ p>
< p>< img src= "images/Plattegrond_kl.jpg" width= "409" height= "346" ></ p>
</ div>
</ p>
< p>& nbsp;</ p>< p>< script language= "JavaScript" type= "text/javascript" >
<!-- Begin
document. write( '<form> '
+ '<input type=button name=print value="Print Pagina" '
+ 'onClick="javascript:window.print()"></form>' ) ;
}
// End -->
</ script></ p></ td>
</ tr>
</ table>
MAILER.PHP:
<?
/* Form Mailer Program */
/* Edit HTML at bottom of script for HTML output */
/* ©2000 YOA/LSYF/YoAi */
$errorpage = "error.htm";
$mailto = "info@pcqualitybonte.nl";
$required = array("subject","email","telefoon"); // what do you wish to require?
// edit below this line at your own risk
$n = 0;
do {
$r = $required[$n];
if(!$$r) {
print Header("Location: $errorpage");
exit;
}
$n++;
} while ($n != count($required));
$a = urldecode($QUERY_STRING);
$a = str_replace("&","\n\n",$a);
$a = str_replace("=",": ",$a);
$a = str_replace("@","_AT_",$a);
mail($mailto,$HTTP_GET_VARS["subject"],$a,"From: $mailto");
?>
<html><head><title>Mail Sent</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h2 align="center"> </h2>
<h2 align="center"><font color="#C10061">Hartelijk dank !</font> </h2>
<p align="center"> </p>
<h2 align="center"><font color="#000066">Uw contact formulier is met succes verzonden.</font></h2>
</body></html>
<?
/* Form Mailer Program */
/* Edit HTML at bottom of script for HTML output */
/* ©2000 YOA/LSYF/YoAi */
$errorpage = "error.htm" ;
$mailto = "info@pcqualitybonte.nl" ;
$required = array ( "subject" , "email" , "telefoon" ) ; // what do you wish to require?
// edit below this line at your own risk
$n = 0 ;
do {
$r = $required [ $n ] ;
if ( ! $$r ) {
}
$n ++;
} while ( $n != count ( $required ) ) ;
mail ( $mailto , $HTTP_GET_VARS [ "subject" ] , $a , "From: $mailto " ) ; ?>
<html><head><title>Mail Sent</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h2 align="center"> </h2>
<h2 align="center"><font color="#C10061">Hartelijk dank !</font> </h2>
<p align="center"> </p>
<h2 align="center"><font color="#000066">Uw contact formulier is met succes verzonden.</font></h2>
</body></html>
3 antwoorden
Gesponsorde links
Kr4nKz1n - 14/09/2008 11:18 (laatste wijziging 14/09/2008 11:23)
Onbekend
Veel code op plaatscode.be graag.
Dit werkt zo niet.
Waarom:
onSubmit="MM_validateForm('voornaam','','R','achternaam','','R','straat','','R','postcode','','RisNum','postcode_nr','','R','plaats','','R','telefoon','','RisNum','email','','RisEmail');return document.MM_returnValue"
onSubmit= "MM_validateForm('voornaam','','R','achternaam','','R','straat','','R','postcode','','RisNum','postcode_nr','','R','plaats','','R','telefoon','','RisNum','email','','RisEmail');return document.MM_returnValue"
Dit kan je beter in PHP doen. Ik neem aan dat je hier controleert of er iets is ingevuld etc. ?
Dat moet je in mailer.php doen met PHP ;)
Veel netter
zointer - 14/09/2008 11:24
HTML gevorderde
Kr4nKz1n schreef:
Veel code op plaatscode.be graag.
Dit werkt zo niet.
[bla]
En waarom hier antwoorden en niet hier ?
Kr4nKz1n - 14/09/2008 11:27 (laatste wijziging 14/09/2008 11:33)
Onbekend
Waarom daar antwoorden en niet hier?
Zijn 2 topics, moet toch ergens kiezen.
Ik had alleen deze gezien, I don`t see your point.
edit
Maar er klopt in ieder geval niks.
Slecht contact formulier
Gesponsorde links
Dit onderwerp is gesloten .