Avatar billede dhunters Nybegynder
12. februar 2003 - 00:39 Der er 24 kommentarer og
1 løsning

Send mail automatisk når side åbner

Hei der.

Jeg har en fakturaside der skal sendes til mig. Hvordan gør jeg det automatisk? Siden skal bare vises normalt. Fakturen skal så, uden at brugeren opdager det, blive sendt videre til mig, så jeg kan behandle bestillingen.

På forhånd tak,
/dhunters
Avatar billede ahv Nybegynder
12. februar 2003 - 00:41 #1
<?php
mail("alexander_hv@hotmail.com", "Faktura", "Du har modtaget en faktura");
?>
Avatar billede schaefner Juniormester
12. februar 2003 - 00:42 #2
Du sætter din mail funktion ind på siden. Normalhvis har du sikkert en eller anden if-ting der tjekker om man f.eks. har trykket på en knap, den fjerne du jo så bare.
Avatar billede ahv Nybegynder
12. februar 2003 - 00:47 #3
aaah det er hele faktura siden der skal sendes til dig samtigdig med at brugeren ser den ikke ?

<?php
mail("alexander_hv@hotmail.com", "Faktura", "

Her skal din fakturaside være

");

?>
Avatar billede dhunters Nybegynder
12. februar 2003 - 01:09 #4
Duer altså ikke... Der kommer ingen mail. Skal der ikke være noget der sætter mail-funktionen i gang?
Sover nu, men kommer tilbage i morgen.

/dhunters
Avatar billede schaefner Juniormester
12. februar 2003 - 01:24 #5
dhunters >> Den starter automatisk. Hvis du f.eks. har denne stump kode på din side:
<?
echo "Hej med dig jeg hedder Kaj";
?>
Så vil det jo også blive udskrevet så snart du kommer ind på siden. Det samme med mail()-funktionen.
Avatar billede tumben Novice
12. februar 2003 - 02:06 #6
<?php
$adr = $REMOTE_ADDR;
$mydate = date("m/d/Y H:i:s");
mail("dinmail@adresse.dk","IP information from remote client","IP address $adr has $mydate og en masse andet sludder.","From:dinmail@adresse.dk.com\nReply-To:dinmail@adresse.dk");
?>

virker her hvis brugeren går ind på en bestemt side på min server...så bliver maiil sendt uden at man ser noget som helst..det er ikkke noget jeg har forstand på....men det virker :-)
Avatar billede schaefner Juniormester
12. februar 2003 - 02:08 #7
tumben >> Den er jo ikke anderledes end den ahv har skrevet andet end indholdet
Avatar billede tumben Novice
12. februar 2003 - 02:13 #8
det sku da lige være mellemrummet efter gnyffen ", " eller ???...men det skal jeg ikke kunne sige...men min virker, og det siger han jo den anden ikke gør, hvad ved jeg !!!.
Avatar billede dhunters Nybegynder
12. februar 2003 - 10:21 #9
Det som ahv har skrevet har jeg sat ind på min side - men der kommer ingen mail. Skal I se koden? Den kan altså godt fylde lidt...
Avatar billede schaefner Juniormester
12. februar 2003 - 10:31 #10
dhunters >> Hvad med det her:
<?php
mail("mai@udbyder.dk","Faktura","Fakturaen","From: $navn <$email>");
echo "Mailen er sørme sendt";
?>
Skriver den noget hvis du sætter det ind?
Avatar billede dhunters Nybegynder
12. februar 2003 - 10:32 #11
Nu duer det! Men nu er det altså hele html-koden der kommer frem - kan det ikke se normalt ud?
Avatar billede ahv Nybegynder
12. februar 2003 - 10:44 #12
dhuters:

Må vi se din kode til faktura siden?
Avatar billede dhunters Nybegynder
12. februar 2003 - 10:45 #13
ok... her kommer:

<html>
<head>
<title>Faktura af ordre</title>
<style>
p {  font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
p.2 {  font-family: Arial, Helvetica, sans-serif; font-size: 34px; color: #000000; border: none}
p.3 {  font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; border: none}
td {  font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
td.2 {  font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none; font-weight: bold}
a {  font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: underline}
a:hover {  font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: none}
</style>
</head>
<body>
<p class="3">Firmaadresse</p>
<p class="2">Faktura</p>
<?
$dato = date("d-m-Y");
echo "<p>Dato: $dato</p>";
?>
<br>
<?
echo "<table>
<tr>
<td>Navn: <b>$navn</b></td>
</tr>
<tr>
<td>Adresse: <b>$adresse</b></td>
</tr>
<tr>
<td>Postnr./by: <b>$by</b></td>
</tr>
<tr>
<td>Tlf.: <b>$tlf</b></td>
</tr>
</table>";
?>
<p>Har bestilt:</p>
<?
$samletpris = 0;
if ($produkt1){
$samletpris +=$pris12;
echo "<table border=1 width=400><tr><td>$produkt11</td><td>$pris12</td></tr>";
}
?>
<?
if ($produkt2){
$samletpris +=$pris22;
echo "<tr><td>$produkt21</td><td>$pris22</td></tr>";
}
?>
<?
if ($produkt3){
$samletpris +=$pris32;
echo "<tr><td>$produkt31</td><td>$pris32</td></tr>";
}
?>
<?
if ($produkt4){
$samletpris +=$pris42;
echo "<tr><td>$produkt41</td><td>$pris42</td></tr>";
}
?>
<?
if ($produkt16){
$samletpris +=$pris162;
echo "<tr><td>$produkt161</td><td>$pris162</td></tr>";
}
?>
<?
if ($produkt5){
$samletpris +=$pris52;
echo "<tr><td>$produkt51</td><td>$pris52</td></tr>";
}
?>
<?
if ($produkt6){
$samletpris +=$pris62;
echo "<tr><td>$produkt61</td><td>$pris62</td></tr>";
}
?>
<?
if ($produkt7){
$samletpris +=$pris72;
echo "<tr><td>$produkt71</td><td>$pris72</td></tr>";
}
?>
<?
if ($produkt8){
$samletpris +=$pris82;
echo "<tr><td>$produkt81</td><td>$pris82</td></tr>";
}
?>
<?
if ($produkt9){
$samletpris +=$pris92;
echo "<tr><td>$produkt91</td><td>$pris92</td></tr>";
}
?>
<?
if ($produkt10){
$samletpris +=$pris102;
echo "<tr><td>$produkt101</td><td>$pris102</td></tr>";
}
?>
<?
if ($produkt11){
$samletpris +=$pris112;
echo "<tr><td>$produkt111</td><td>$pris112</td></tr>";
}
?>
<?
if ($produkt12){
$samletpris +=$pris122;
echo "<tr><td>$produkt121</td><td>$pris122</td></tr>";
}
?>
<?
if ($produkt13){
$samletpris +=$pris132;
echo "<tr><td>$produkt131</td><td>$pris132</td></tr>";
}
?>
<?
if ($produkt14){
$samletpris +=$pris142;
echo "<tr><td>$produkt141</td><td>$pris142</td></tr>";
}
?>
<?
if ($produkt15){
$samletpris +=$pris152;
echo "<tr><td>$produkt151</td><td>$pris152</td></tr>";
}
?>
<?
echo "<tr><td class=2>I alt:</td><td class=2>";
echo number_format($samletpris,2,",",".");
echo "</td></tr></table>";
?>
<br><p><a href="java script:print()">Udskriv faktura</a></p>
</body>
</html>

<?php
mail("webmaster@swimhsk.dk","Poolshopbestilling fra $navn","<html>
<head>
<title>Faktura af ordre</title>
<style>
p {  font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
p.2 {  font-family: Arial, Helvetica, sans-serif; font-size: 34px; color: #000000; border: none}
p.3 {  font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; border: none}
td {  font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
td.2 {  font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none; font-weight: bold}
a {  font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: underline}
a:hover {  font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: none}
</style>
</head>
<body>
<p class='3'>Firmaadresse</p>
<p class='2'>Faktura</p>
<?
$dato = date('d-m-Y');
echo '<p>Dato: $dato</p>';
?>
<br>
<?
echo '<table>
<tr>
<td>Navn: <b>$navn</b></td>
</tr>
<tr>
<td>Adresse: <b>$adresse</b></td>
</tr>
<tr>
<td>Postnr./by: <b>$by</b></td>
</tr>
<tr>
<td>Tlf.: <b>$tlf</b></td>
</tr>
</table>';
?>
<p>Har bestilt:</p>
<?
$samletpris = 0;
if ($produkt1){
$samletpris +=$pris12;
echo '<table border=1 width=400><tr><td>$produkt11</td><td>$pris12</td></tr>';
}
?>
<?
if ($produkt2){
$samletpris +=$pris22;
echo '<tr><td>$produkt21</td><td>$pris22</td></tr>';
}
?>
<?
if ($produkt3){
$samletpris +=$pris32;
echo '<tr><td>$produkt31</td><td>$pris32</td></tr>';
}
?>
<?
if ($produkt4){
$samletpris +=$pris42;
echo '<tr><td>$produkt41</td><td>$pris42</td></tr>';
}
?>
<?
if ($produkt16){
$samletpris +=$pris162;
echo '<tr><td>$produkt161</td><td>$pris162</td></tr>';
}
?>
<?
if ($produkt5){
$samletpris +=$pris52;
echo '<tr><td>$produkt51</td><td>$pris52</td></tr>';
}
?>
<?
if ($produkt6){
$samletpris +=$pris62;
echo '<tr><td>$produkt61</td><td>$pris62</td></tr>';
}
?>
<?
if ($produkt7){
$samletpris +=$pris72;
echo '<tr><td>$produkt71</td><td>$pris72</td></tr>';
}
?>
<?
if ($produkt8){
$samletpris +=$pris82;
echo '<tr><td>$produkt81</td><td>$pris82</td></tr>';
}
?>
<?
if ($produkt9){
$samletpris +=$pris92;
echo '<tr><td>$produkt91</td><td>$pris92</td></tr>';
}
?>
<?
if ($produkt10){
$samletpris +=$pris102;
echo '<tr><td>$produkt101</td><td>$pris102</td></tr>';
}
?>
<?
if ($produkt11){
$samletpris +=$pris112;
echo '<tr><td>$produkt111</td><td>$pris112</td></tr>';
}
?>
<?
if ($produkt12){
$samletpris +=$pris122;
echo '<tr><td>$produkt121</td><td>$pris122</td></tr>';
}
?>
<?
if ($produkt13){
$samletpris +=$pris132;
echo '<tr><td>$produkt131</td><td>$pris132</td></tr>';
}
?>
<?
if ($produkt14){
$samletpris +=$pris142;
echo '<tr><td>$produkt141</td><td>$pris142</td></tr>';
}
?>
<?
if ($produkt15){
$samletpris +=$pris152;
echo '<tr><td>$produkt151</td><td>$pris152</td></tr>';
}
?>
<?
echo '<tr><td class=2>I alt:</td><td class=2>';
echo number_format($samletpris,2,',','.');
echo '</td></tr></table>';
?>
</body>
</html>", "From: $navn <$email>\nX-Mailer: http://$HTTP_HOST$REQUEST_URI");

?>
Avatar billede schaefner Juniormester
12. februar 2003 - 12:11 #14
Hvorfor starter og slutter du din php kode lige efter hinanden?
Avatar billede ahv Nybegynder
12. februar 2003 - 15:10 #15
Prøv dette:

<html>
<head>
<title>Faktura af ordre</title>
<style>
p { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
p.2 { font-family: Arial, Helvetica, sans-serif; font-size: 34px; color: #000000; border: none}
p.3 { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; border: none}
td { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
td.2 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none; font-weight: bold}
a { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: underline}
a:hover { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: none}
</style>
</head>
<body>
<p class="3">Firmaadresse</p>
<p class="2">Faktura</p>
<?
$dato = date("d-m-Y");
echo "<p>Dato: $dato</p>";
?>
<br>
<?
echo "<table>
<tr>
<td>Navn: <b>$navn</b></td>
</tr>
<tr>
<td>Adresse: <b>$adresse</b></td>
</tr>
<tr>
<td>Postnr./by: <b>$by</b></td>
</tr>
<tr>
<td>Tlf.: <b>$tlf</b></td>
</tr>
</table>";
?>
<p>Har bestilt:</p>
<?
$samletpris = 0;
if ($produkt1){
$samletpris +=$pris12;
echo "<table border=1 width=400><tr><td>$produkt11</td><td>$pris12</td></tr>";
}
?>
<?
if ($produkt2){
$samletpris +=$pris22;
echo "<tr><td>$produkt21</td><td>$pris22</td></tr>";
}
?>
<?
if ($produkt3){
$samletpris +=$pris32;
echo "<tr><td>$produkt31</td><td>$pris32</td></tr>";
}
?>
<?
if ($produkt4){
$samletpris +=$pris42;
echo "<tr><td>$produkt41</td><td>$pris42</td></tr>";
}
?>
<?
if ($produkt16){
$samletpris +=$pris162;
echo "<tr><td>$produkt161</td><td>$pris162</td></tr>";
}
?>
<?
if ($produkt5){
$samletpris +=$pris52;
echo "<tr><td>$produkt51</td><td>$pris52</td></tr>";
}
?>
<?
if ($produkt6){
$samletpris +=$pris62;
echo "<tr><td>$produkt61</td><td>$pris62</td></tr>";
}
?>
<?
if ($produkt7){
$samletpris +=$pris72;
echo "<tr><td>$produkt71</td><td>$pris72</td></tr>";
}
?>
<?
if ($produkt8){
$samletpris +=$pris82;
echo "<tr><td>$produkt81</td><td>$pris82</td></tr>";
}
?>
<?
if ($produkt9){
$samletpris +=$pris92;
echo "<tr><td>$produkt91</td><td>$pris92</td></tr>";
}
?>
<?
if ($produkt10){
$samletpris +=$pris102;
echo "<tr><td>$produkt101</td><td>$pris102</td></tr>";
}
?>
<?
if ($produkt11){
$samletpris +=$pris112;
echo "<tr><td>$produkt111</td><td>$pris112</td></tr>";
}
?>
<?
if ($produkt12){
$samletpris +=$pris122;
echo "<tr><td>$produkt121</td><td>$pris122</td></tr>";
}
?>
<?
if ($produkt13){
$samletpris +=$pris132;
echo "<tr><td>$produkt131</td><td>$pris132</td></tr>";
}
?>
<?
if ($produkt14){
$samletpris +=$pris142;
echo "<tr><td>$produkt141</td><td>$pris142</td></tr>";
}
?>
<?
if ($produkt15){
$samletpris +=$pris152;
echo "<tr><td>$produkt151</td><td>$pris152</td></tr>";
}
?>
<?
echo "<tr><td class=2>I alt:</td><td class=2>";
echo number_format($samletpris,2,",",".");
echo "</td></tr></table>";
?>
<br><p><a href="java script:print()">Udskriv faktura</a></p>
</body>
</html>



<?php

mail("alexander_hv@hotmail.com", "Faktura", "

<html>
<head>
<title>Faktura af ordre</title>
<style>
p { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
p.2 { font-family: Arial, Helvetica, sans-serif; font-size: 34px; color: #000000; border: none}
p.3 { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; border: none}
td { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
td.2 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none; font-weight: bold}
a { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: underline}
a:hover { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: none}
</style>
</head>
<body>
<p class='3'>Firmaadresse</p>
<p class='2'>Faktura</p>

<p>Dato: $dato
<br>
<table>
<tr>
<td>Navn: <b>$navn</b></td>
</tr>
<tr>
<td>Adresse: <b>$adresse</b></td>
</tr>
<tr>
<td>Postnr./by: <b>$by</b></td>
</tr>
<tr>
<td>Tlf.: <b>$tlf</b></td>
</tr>
</table>
<p>Har bestilt:</p>

<table border=1 width=400><tr><td>$produkt11</td><td>$pris12</td></tr>

<tr><td>$produkt21</td><td>$pris22</td></tr>

<tr><td>$produkt31</td><td>$pris32</td></tr>

<tr><td>$produkt41</td><td>$pris42</td></tr>

<tr><td>$produkt161</td><td>$pris162</td></tr>

<tr><td>$produkt51</td><td>$pris52</td></tr>

<tr><td>$produkt61</td><td>$pris62</td></tr>

<tr><td>$produkt71</td><td>$pris72</td></tr>

<tr><td>$produkt81</td><td>$pris82</td></tr>

<tr><td>$produkt91</td><td>$pris92</td></tr>

<tr><td>$produkt101</td><td>$pris102</td></tr>

<tr><td>$produkt111</td><td>$pris112</td></tr>

<tr><td>$produkt121</td><td>$pris122</td></tr>

<tr><td>$produkt131</td><td>$pris132</td></tr>

<tr><td>$produkt141</td><td>$pris142</td></tr>

<tr><td>$produkt151</td><td>$pris152</td></tr>

<tr><td class=2>I alt:</td><td class=2>
$samletpris
</td></tr></table>

</body>
</html>

");

?>
Avatar billede ahv Nybegynder
12. februar 2003 - 15:11 #16
Husk at udskifte min mail til din egen.
Avatar billede ahv Nybegynder
12. februar 2003 - 15:14 #17
Lige en lille rettelse, vi tager det hele igen (jeg har rettet den til din mail)

<html>
<head>
<title>Faktura af ordre</title>
<style>
p { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
p.2 { font-family: Arial, Helvetica, sans-serif; font-size: 34px; color: #000000; border: none}
p.3 { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; border: none}
td { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
td.2 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none; font-weight: bold}
a { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: underline}
a:hover { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: none}
</style>
</head>
<body>
<p class="3">Firmaadresse</p>
<p class="2">Faktura</p>
<?
$dato = date("d-m-Y");
echo "<p>Dato: $dato</p>";
?>
<br>
<?
echo "<table>
<tr>
<td>Navn: <b>$navn</b></td>
</tr>
<tr>
<td>Adresse: <b>$adresse</b></td>
</tr>
<tr>
<td>Postnr./by: <b>$by</b></td>
</tr>
<tr>
<td>Tlf.: <b>$tlf</b></td>
</tr>
</table>";
?>
<p>Har bestilt:</p>
<?
$samletpris = 0;
if ($produkt1){
$samletpris +=$pris12;
echo "<table border=1 width=400><tr><td>$produkt11</td><td>$pris12</td></tr>";
}
?>
<?
if ($produkt2){
$samletpris +=$pris22;
echo "<tr><td>$produkt21</td><td>$pris22</td></tr>";
}
?>
<?
if ($produkt3){
$samletpris +=$pris32;
echo "<tr><td>$produkt31</td><td>$pris32</td></tr>";
}
?>
<?
if ($produkt4){
$samletpris +=$pris42;
echo "<tr><td>$produkt41</td><td>$pris42</td></tr>";
}
?>
<?
if ($produkt16){
$samletpris +=$pris162;
echo "<tr><td>$produkt161</td><td>$pris162</td></tr>";
}
?>
<?
if ($produkt5){
$samletpris +=$pris52;
echo "<tr><td>$produkt51</td><td>$pris52</td></tr>";
}
?>
<?
if ($produkt6){
$samletpris +=$pris62;
echo "<tr><td>$produkt61</td><td>$pris62</td></tr>";
}
?>
<?
if ($produkt7){
$samletpris +=$pris72;
echo "<tr><td>$produkt71</td><td>$pris72</td></tr>";
}
?>
<?
if ($produkt8){
$samletpris +=$pris82;
echo "<tr><td>$produkt81</td><td>$pris82</td></tr>";
}
?>
<?
if ($produkt9){
$samletpris +=$pris92;
echo "<tr><td>$produkt91</td><td>$pris92</td></tr>";
}
?>
<?
if ($produkt10){
$samletpris +=$pris102;
echo "<tr><td>$produkt101</td><td>$pris102</td></tr>";
}
?>
<?
if ($produkt11){
$samletpris +=$pris112;
echo "<tr><td>$produkt111</td><td>$pris112</td></tr>";
}
?>
<?
if ($produkt12){
$samletpris +=$pris122;
echo "<tr><td>$produkt121</td><td>$pris122</td></tr>";
}
?>
<?
if ($produkt13){
$samletpris +=$pris132;
echo "<tr><td>$produkt131</td><td>$pris132</td></tr>";
}
?>
<?
if ($produkt14){
$samletpris +=$pris142;
echo "<tr><td>$produkt141</td><td>$pris142</td></tr>";
}
?>
<?
if ($produkt15){
$samletpris +=$pris152;
echo "<tr><td>$produkt151</td><td>$pris152</td></tr>";
}
?>
<?
echo "<tr><td class=2>I alt:</td><td class=2>";
echo number_format($samletpris,2,",",".");
echo "</td></tr></table>";
?>
<br><p><a href="java script:print()">Udskriv faktura</a></p>
</body>
</html>



<?php

mail("webmaster@swimhsk.dk", "Faktura", "

<html>
<head>
<title>Faktura af ordre</title>
<style>
p { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
p.2 { font-family: Arial, Helvetica, sans-serif; font-size: 34px; color: #000000; border: none}
p.3 { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; border: none}
td { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
td.2 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none; font-weight: bold}
a { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: underline}
a:hover { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: none}
</style>
</head>
<body>
<p class='3'>Firmaadresse</p>
<p class='2'>Faktura</p>

<p>Dato: $dato
<br>
<table>
<tr>
<td>Navn: <b>$navn</b></td>
</tr>
<tr>
<td>Adresse: <b>$adresse</b></td>
</tr>
<tr>
<td>Postnr./by: <b>$by</b></td>
</tr>
<tr>
<td>Tlf.: <b>$tlf</b></td>
</tr>
</table>
<p>Har bestilt:</p>

<table border=1 width=400><tr><td>$produkt11</td><td>$pris12</td></tr>

<tr><td>$produkt21</td><td>$pris22</td></tr>

<tr><td>$produkt31</td><td>$pris32</td></tr>

<tr><td>$produkt41</td><td>$pris42</td></tr>

<tr><td>$produkt161</td><td>$pris162</td></tr>

<tr><td>$produkt51</td><td>$pris52</td></tr>

<tr><td>$produkt61</td><td>$pris62</td></tr>

<tr><td>$produkt71</td><td>$pris72</td></tr>

<tr><td>$produkt81</td><td>$pris82</td></tr>

<tr><td>$produkt91</td><td>$pris92</td></tr>

<tr><td>$produkt101</td><td>$pris102</td></tr>

<tr><td>$produkt111</td><td>$pris112</td></tr>

<tr><td>$produkt121</td><td>$pris122</td></tr>

<tr><td>$produkt131</td><td>$pris132</td></tr>

<tr><td>$produkt141</td><td>$pris142</td></tr>

<tr><td>$produkt151</td><td>$pris152</td></tr>

<tr><td class=2>I alt:</td><td class=2>
$samletpris
</td></tr></table>

</body>
</html>

", "From: $navn <$email>\nX-Mailer: <http://$HTTP_HOST$REQUEST_URI>");
?>
Avatar billede dhunters Nybegynder
12. februar 2003 - 16:49 #18
Duer stadig ikke -> men jeg har tænkt. Hvis man nu bygger siden op i frames kan man så ikke få den ene side til at sende den anden?
Avatar billede ahv Nybegynder
12. februar 2003 - 17:00 #19
Overstående kode virker fint hos mig.
Avatar billede dhunters Nybegynder
12. februar 2003 - 17:01 #20
Kommer den frem med en normal side i din mailbox? i outlook? For hos mig er der bare masser af god kode... :?
Avatar billede ahv Nybegynder
12. februar 2003 - 17:06 #21
Ja den kommer frem med:

Firmaadresse

Faktura

Dato: 12-02-2003
Navn: 
Adresse: 
Postnr./by: 
Tlf.: 


Har bestilt:

I alt: 0


Og det er via hotmail.
Har du evt. icq eller msn?

ICQ: 82550004
msn: alexander_hv@hotmail.com
Avatar billede dhunters Nybegynder
12. februar 2003 - 17:40 #22
MSN tak - så kan det måske komme til at fungere...
Avatar billede haken Nybegynder
12. februar 2003 - 22:18 #23
det er fordi du skal have en header med i din mail der fortæller det er html og ikke almindelig text du sender.

eks.

mail("en@mailadresse.com", "Faktura", "Bla Bla", "From: Mail emne <mail@mail.com>\nReply-to: mail@mail.com\nContent-type: text/html; charset=iso-8859-1");

text/html; charset=iso-8859-1 fortæller at det er html og at det skal vises som det og ikke som normal tekst.
Avatar billede dhunters Nybegynder
13. februar 2003 - 13:52 #24
haken -> det virker helt kanon! Men nu er der bare stadig et problem. Når mailen kommer frem hos mig er der ingen bestilling på - hvordan kan jeg lave det sådan at jeg får en eksakt kopi af fakturen der bliver vist til forbrugeren?

/dhunters
Avatar billede ahv Nybegynder
13. februar 2003 - 17:27 #25
<html>
<head>
<title>Faktura af ordre</title>
<style>
p {  font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
p.2 {  font-family: Arial, Helvetica, sans-serif; font-size: 34px; color: #000000; border: none}
p.3 {  font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; border: none}
td {  font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
td.2 {  font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none; font-weight: bold}
a {  font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: underline}
a:hover {  font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: none}
</style>
</head>
<body>
<p class="3">Holbæk Svømme Klub, Vandtårnsvej 8, 4300 Holbæk, Danmark</p>
<p class="2">Faktura</p>
<?
$dato = date("d-m-Y");
echo "<p>Dato: $dato</p>";
?>
<br>
<?
echo "<table>
<tr>
<td>Navn: <b>$_POST[navn]</b></td>
</tr>
<tr>
<td>Adresse: <b>$_POST[adresse]</b></td>
</tr>
<tr>
<td>Postnr./by: <b>$_POST[by]</b></td>
</tr>
<tr>
<td>Tlf.: <b>$_POST[tlf]</b></td>
</tr>
</table>";
?>
<p>Har bestilt:</p>
<?
$samletpris = 0;

echo "<table border=1 width=400>";

if ($_POST[produktt1]){
$samletpris +=$_POST[prist12];
echo "<tr><td>$_POST[produktt11]</td><td>$_POST[prist12]</td></tr>";
}else{
$_POST[produktt11] = "";
$_POST[prist12] = "";
}

if ($_POST[produkt2]){
$samletpris +=$_POST[pris22];
echo "<tr><td>$_POST[produkt21]</td><td>$_POST[pris22]</td></tr>";
}else{
$_POST[produkt21] = "";
$_POST[pris22] = "";
}

if ($_POST[produkt3]){
$samletpris +=$_POST[pris32];
echo "<tr><td>$_POST[produkt31]</td><td>$_POST[pris32]</td></tr>";
}else{
$_POST[produkt31] = "";
$_POST[pris32] = "";
}

if ($_POST[produkt4]){
$samletpris +=$_POST[pris42];
echo "<tr><td>$_POST[produkt41]</td><td>$_POST[pris42]</td></tr>";
}else{
$_POST[produkt41] = "";
$_POST[pris42] = "";
}

if ($_POST[produkt16]){
$samletpris +=$_POST[pris162];
echo "<tr><td>$_POST[produkt161]</td><td>$_POST[pris162]</td></tr>";
}else{
$_POST[produkt161] = "";
$_POST[pris162] = "";
}

if ($_POST[produkt5]){
$samletpris +=$_POST[pris52];
echo "<tr><td>$_POST[produkt51]</td><td>$_POST[pris52]</td></tr>";
}else{
$_POST[produkt51] = "";
$_POST[pris52] = "";
}

if ($_POST[produkt6]){
$samletpris +=$_POST[pris62];
echo "<tr><td>$_POST[produkt61]</td><td>$_POST[pris62]</td></tr>";
}else{
$_POST[produkt61] = "";
$_POST[pris62] = "";
}

if ($_POST[produkt7]){
$samletpris +=$_POST[pris72];
echo "<tr><td>$_POST[produkt71]</td><td>$_POST[pris72]</td></tr>";
}else{
$_POST[produkt71] = "";
$_POST[pris72] = "";
}

if ($_POST[produkt8]){
$samletpris +=$_POST[pris82];
echo "<tr><td>$_POST[produkt81]</td><td>$_POST[pris82]</td></tr>";
}else{
$_POST[produkt81] = "";
$_POST[pris82] = "";
}

if ($_POST[produkt9]){
$samletpris +=$_POST[pris92];
echo "<tr><td>$_POST[produkt91]</td><td>$_POST[pris92]</td></tr>";
}else{
$_POST[produkt91] = "";
$_POST[pris92] = "";
}

if ($_POST[produkt10]){
$samletpris +=$_POST[pris102];
echo "<tr><td>$_POST[produkt101]</td><td>$_POST[pris102]</td></tr>";
}else{
$_POST[produkt101] = "";
$_POST[pris102] = "";
}

if ($_POST[produkte11]){
$samletpris +=$_POST[pris112];
echo "<tr><td>$_POST[produkt111]</td><td>$_POST[pris112]</td></tr>";
}else{
$_POST[produkt111] = "";
$_POST[pris112] = "";
}

if ($_POST[produkt12]){
$samletpris +=$_POST[pris122];
echo "<tr><td>$_POST[produkt121]</td><td>$_POST[pris122]</td></tr>";
}else{
$_POST[produkt121] = "";
$_POST[pris122] = "";
}

if ($_POST[produkt13]){
$samletpris +=$_POST[pris132];
echo "<tr><td>$_POST[produkt131]</td><td>$_POST[pris132]</td></tr>";
}else{
$_POST[produkt131] = "";
$_POST[pris132] = "";
}

if ($_POST[produkt14]){
$samletpris +=$_POST[pris142];
echo "<tr><td>$_POST[produkt141]</td><td>$_POST[pris142]</td></tr>";
}else{
$_POST[produkt141] = "";
$_POST[pris142] = "";
}

if ($_POST[produkt15]){
$samletpris +=$_POST[pris152];
echo "<tr><td>$_POST[produkt151]</td><td>$_POST[pris152]</td></tr>";
}else{
$_POST[produkt151] = "";
$_POST[pris152] = "";
}

echo "<tr><td class=2>I alt:</td><td class=2>";
echo number_format($samletpris,2,",",".");
echo "</td></tr></table>";
?>
<br><p><a href="java script:print()">Udskriv faktura</a></p>
</body>
</html>




<?php

mail("webmaster@swimhsk.dk", "Faktura", "

<html>
<head>
<title>Faktura af ordre</title>
<style>
p { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
p.2 { font-family: Arial, Helvetica, sans-serif; font-size: 34px; color: #000000; border: none}
p.3 { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; border: none}
td { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none}
td.2 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; border: none; font-weight: bold}
a { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: underline}
a:hover { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: none}
</style>
</head>
<body>
<p class='3'>Firmaadresse</p>
<p class='2'>Faktura</p>

<p>Dato: $dato
<br>
<table>
<tr>
<td>Navn: <b>$_POST[navn]</b></td>
</tr>
<tr>
<td>Adresse: <b>$_POST[adresse]</b></td>
</tr>
<tr>
<td>Postnr./by: <b>$_POST[by]</b></td>
</tr>
<tr>
<td>Tlf.: <b>$_POST[tlf]</b></td>
</tr>
</table>
<p>Har bestilt:</p>

<table border=1 width=400><tr><td>$_POST[produktt11]</td><td>$_POST[prist12]</td></tr>

<tr><td>$_POST[produkt21]</td><td>$_POST[pris22]</td></tr>

<tr><td>$_POST[produkt31]</td><td>$_POST[pris32]</td></tr>

<tr><td>$_POST[produkt41]</td><td>$_POST[pris42]</td></tr>

<tr><td>$_POST[produkt161]</td><td>$_POST[pris162]</td></tr>

<tr><td>$_POST[produkt51]</td><td>$_POST[pris52]</td></tr>

<tr><td>$_POST[produkt61]</td><td>$_POST[pris62]</td></tr>


<tr><td>$_POST[produkt71]</td><td>$_POST[pris72]</td></tr>

<tr><td>$_POST[produkt81]</td><td>$_POST[pris82]</td></tr>

<tr><td>$_POST[produkt91]</td><td>$_POST[pris92]</td></tr>

<tr><td>$_POST[produkt101]</td><td>$_POST[pris102]</td></tr>

<tr><td>$_POST[produkt111]</td><td>$_POST[pris112]</td></tr>

<tr><td>$_POST[produkt121]</td><td>$_POST[pris122]</td></tr>

<tr><td>$_POST[produkt131]</td><td>$_POST[pris132]</td></tr>

<tr><td>$_POST[produkt141]</td><td>$_POST[pris142]</td></tr>

<tr><td>$_POST[produkt151]</td><td>$_POST[pris152]</td></tr>

<tr><td class=2>I alt:</td><td class=2>
$samletpris
</td></tr></table>
</body>
</html>
", "From: $navn <$email>\nContent-type: text/html; charset=iso-8859-1");

?>
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester