Jeg har prøvet og prøvet at få denne bestillings mail form til at
virke, men kan ikke.. :(
Nogle af jer der kan en bedre eller kan finde min fejl?
Laver min side i php og her er koden for hele start side:
<?php
include("header.php");
if ( $_POST['send'] ) {
if (!$_POST['on'] OR !$_POST['navn'] OR !$_POST['adresse']
OR !$_POST['postnr'] OR !$_POST['email']) {
$error = "You need to fill out the whole form";
}
if
(!preg_match("/^([\w|\.|\-|_]+)@([\w||\-|_]+)\.([\w|\.|\-|_]+)$/i
", $_POST['email'])) {
$error = "<br>Your email was invalid";
}
if ( !$error ) {
$email = $_POST['email'];
$navn = $_POST['navn'];
$vare = $_POST['on'];
$adresse = $_POST['adresse'];
$postnr = $_POST['postnr'];
$til = "Joy-hansen@hotmail.com";
$headers = "From: $navn <$email>\n";
$headers .= "Reply-to: $email\n";
$headers .= "X-Sender: <$email>\n";
$headers .= "X-Mailer: $email\n";
$headers .= "X-Priority: 3\n";
$headers .= "Return-Path: <$email>\n";
mail("$til","$email","$navn","$vare","$adresse","$postnr","$heade
rs");
{
?>
<br><center><font face="Tahoma" style="font-size: 8pt"
color="#FFFFFF">Tak for din bestilling!</font></center>
<br>
<?php
}
$sendt = "1";
}else{
echo "<b>$error</b>";
}
}
if ( !$sendt ) {
?>
<TABLE width="500" border="2">
<TR>
<TD bordercolor="#FFFFFF" bgcolor="#F0F0F0">
<font face="Tahoma" style="font-size: 8pt" color="#000000"><br>
<center><b>Bestillingsliste!</b></center><br>
<p align="justify">
<FORM action="" method="POST">
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" width="462"
height="1">
<tr>
<td width="46" height="23" valign="top" align="right">
<input name="on" type="checkbox" value="hvid">
</td>
<td width="281" height="23" valign="top"><font face="Tahoma"
style="font-size: 8pt" color="#000000">Cilia Hvid</td>
<td width="129" height="23" valign="top"><font face="Tahoma"
style="font-size: 8pt" color="#000000">Pris: 60,- </td>
</tr>
<tr>
<td width="46" height="1" valign="top" align="right">
<input name="on" type="checkbox" value="rød">
</td>
<td width="281" height="1" valign="top"><font face="Tahoma"
style="font-size: 8pt" color="#000000">Cilia Rød</td>
<td width="129" height="23" valign="top"><font face="Tahoma"
style="font-size: 8pt" color="#000000">Pris: 60,- </td>
</tr>
<tr>
<td width="46" height="1" valign="top" align="right">
<input name="on" type="checkbox" value="blå">
</td>
<td width="281" height="1" valign="top"><font face="Tahoma"
style="font-size: 8pt" color="#000000">Cilia Blå</td>
<td width="129" height="23" valign="top"><font face="Tahoma"
style="font-size: 8pt" color="#000000">Pris: 60,- </td>
</tr>
<tr>
<td width="46" height="1" valign="top" align="right">
<input name="on" type="checkbox" value="grøn">
</td>
<td width="281" height="1" valign="top"><font face="Tahoma"
style="font-size: 8pt" color="#000000">Cilia Grøn</td>
<td width="129" height="23" valign="top"><font face="Tahoma"
style="font-size: 8pt" color="#000000">Pris: 60,- </td>
</tr>
<tr>
<td width="46" height="1" valign="top" align="right">
<input name="on" type="checkbox" value="sort">
</td>
<td width="281" height="1" valign="top"><font face="Tahoma"
style="font-size: 8pt" color="#000000">Cilia Sort</td>
<td width="129" height="23" valign="top"><font face="Tahoma"
style="font-size: 8pt" color="#000000">Pris: 60,- </td>
</tr>
</table>
</div>
<div align="justify">
<table width="381" border="0" cellpadding="0" height="119"
cellspacing="0">
<tr>
<td width="100" align="right" height="30"><font face="Tahoma"
style="font-size: 8pt" color="#000000">Dit navn: </font>
<td width="100" align="left" height="30"><input type="text"
size="20" maxlength="256" name="navn">
</tr>
<tr>
<td width="100" align="right" height="30"><font face="Tahoma"
style="font-size: 8pt" color="#000000">Adresse: </font>
<td width="100" align="left" height="30"><input type="text"
size="40" maxlength="256" name="adresse">
</tr>
<tr>
<td width="100" align="right" height="30"><font face="Tahoma"
style="font-size: 8pt" color="#000000">Postnr og by.: </font>
<td width="100" align="left" height="30"><input type="text"
size="30" maxlength="256" name="postnr">
</tr>
<tr>
<td width="100" align="right" height="30"><font face="Tahoma"
style="font-size: 8pt" color="#000000">E-mail: </font>
<td width="100" align="left" height="30"><input type="text"
size="30" maxlength="256" name="email">
</tr>
</table>
</div>
<p align="left">
Evt. Bemærkninger<br>
<center><textarea type="HIDDEN" name="medsend"
value="kommentar"></textarea><br>
<input type="submit" value="send" name="send"><input type="reset"
value="Fortryd"></form></p></center>
</TD>
<TR>
</TABLE>
<?php
}
include("footer.php"); ?>
--
Vil du lære at kode HTML, XHTML, CSS, SSI, ASP eller ASP.NET?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials