/ Forside / Teknologi / Udvikling / HTML / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
HTML
#NavnPoint
molokyle 11184
Klaudi 5506
bentjuul 3377
severino 2040
smorch 1950
strarup 1525
natmaden 1396
scootergr.. 1320
e.c 1150
10  miritdk 1110
Bestillings mail form?
Fra : Joy


Dato : 18-02-07 17:04

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">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; 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

 
 
Brian B. Christensen (18-02-2007)
Kommentar
Fra : Brian B. Christensen


Dato : 18-02-07 18:06

On 18 Feb 2007 16:03:57 GMT, Joy <joy-hansen@hotmail.com> wrote:

>Nogle af jer der kan en bedre eller kan finde min fejl?

Hvis du vil gøre dig ulejligheden at fortælle HVAD der ikke virker.
Gerne med et link til siden. Så skal vi jo ikke bruge tid på det.....

Hvis det er et PHP problem, kunne du med fordel også poste det i
dk.edb.internet.webdesign.serverside.php - husk at skrive hvad fejlen
er!

Mvh. Brian
--
Creator of http://www.natart.dk

Søg
Reklame
Statistik
Spørgsmål : 177501
Tips : 31968
Nyheder : 719565
Indlæg : 6408524
Brugere : 218887

Månedens bedste
Årets bedste
Sidste års bedste