Php mail script met dreamweaver forms werkt niet?

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Hidde van Koningsveld

Hidde van Koningsveld

18/08/2008 11:07:00
Quote Anchor link
Ik heb een pagina gemaakt waar mensen offertes aan kunnen vragen. Via Youtube heb ik een videotutuorial gevolgd (http://nl.youtube.com/watch?v=rdsz9Ie6h7I). Maar het enige dat in de mail staat is dit:
Email:

Naam:

Website-editor:

HTML:

PHP:

Website titel:

Website onderwerp:

Domeinnaam en webruimte registreren:

Gewenste domeinnaam:

Mijn php file (http://www.*.nl):
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
/* Subject and Email Variables */


    $emailSubject = 'Offerte Aanvraag ';
    $webMaster = '*@*.nl';
    
/* Gathering Data Variables */

    $naamVeld = $_POST['naam'];
    $emailVeld = $_POST['email'];
    $editorVeld = $_POST['websiteeditor'];
    $htmlVeld = $_POST['html'];
    $phpVeld = $_POST['php'];
    $titelVeld = $_POST['titel'];
    $onderwerpVeld = $_POST['onderwerp'];
    $registratieVeld = $_POST['regdomeinnaam'];
    $domeinVeld = $_POST['gewdomeinnaam'];
    
    $body = <<<EOD
<br><hr><br>
Email: $email <br>
Naam: $naam <br>
Website-editor: $websiteeditor <br>
HTML: $html <br>
PHP: $php <br>
Website titel: $titel <br>
Website onderwerp: $onderwerp <br>
Domeinnaam en webruimte registreren: $regdomeinnaam <br>
Gewenste domeinnaam: $gewdomeinnaam
EOD
;

    $headers = "From: $email\r\n";
    $headers .= "Content-type: text/html\r\n";
    $success = mail($webMaster, $emailSubject, $body, $headers);
    
/* Results rendered as HTML */

    $theResults = <<<EOD
<html>
<head>
<title>* - Webdesign</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
<!--
body,td,th {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #000000;
}
.style1 {font-size: 12px}
a:link {
    color: #ACBD0D;
    text-decoration: none;
}
a:visited {
    text-decoration: none;
    color: #ACBD0D;
}
a:hover {
    text-decoration: none;
    color: #FFA200;
}
a:active {
    text-decoration: none;
    color: #ACBD0D;
}
-->
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (website108AFMAKEN.psd) -->
<table width="760" height="770" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
  <tr>
    <td colspan="2"><img src="*.png" alt="" width="760" height="319" border="0"></td>
  </tr>
  <tr>
    <td width="227"><img src="*.png" alt="" width="227" height="451" border="0" usemap="#Map"></td>
    <td width="533" background="*.png"><div align="center">
      <p>Uw offerteaanvraag is succesvol verzonden. </p>
      <p>Wij zullen zo snel mogelijk contact met u opnemen.</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p class="style1">&nbsp;</p>
      <p class="style1">&nbsp;</p>
      <p class="style1">&nbsp;</p>
      <p class="style1">&nbsp;</p>
      <p class="style1">&nbsp;</p>
      <p class="style1">&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
    </div></td>
  </tr>
</table>
<!-- End ImageReady Slices -->
<map name="Map">
  <area shape="rect" coords="19,91,145,114" href="*.html" target="_self">
  <area shape="rect" coords="22,132,146,154" href="*.html" target="_self">
  <area shape="rect" coords="21,172,145,193" href="*.html" target="_self">
  <area shape="rect" coords="21,212,145,232" href="*.html" target="_self">
  <area shape="rect" coords="19,251,144,273" href="*.html" target="_self">
</map>
</body>
</html>
EOD
;
echo "$theResults";
?>


de pagina met de forms (http://www.*.nl):
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<html>
<head>
<title>* - Webdesign</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
<!--
body,td,th {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #000000;
}
a:link {
    color: #ACBD0D;
    text-decoration: none;
}
a:visited {
    text-decoration: none;
    color: #ACBD0D;
}
a:hover {
    text-decoration: none;
    color: #FFA200;
}
a:active {
    text-decoration: none;
    color: #ACBD0D;
}
-->
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (website108AFMAKEN.psd) -->
<table width="760" height="770" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
  <tr>
    <td colspan="2"><img src="*.png" alt="" width="760" height="319" border="0"></td>
  </tr>
  <tr>
    <td width="227"><img src="*.png" alt="" width="227" height="451" border="0" usemap="#Map"></td>
    <td width="533" background="*.png"><div align="center">
      <form name="form1" method="post" action="*.php">
        <p>
          <label>Naam:
          <input name="naam" type="text" id="naam">
          </label>
        </p>
        <p>
          <label>E-mail:
          <input name="email" type="text" id="email">
          </label>
        </p>
        <p>
          <label>
          <input type="radio" name="websiteeditor" value="websiteeditor">
Lever mijn website met de website-editor</label>
          <br>
          <label>
          <input type="radio" name="html" value="html">
Lever mijn website in HTML</label>
          <br>
          <label>
          <input type="radio" name="php" value="php">
Lever mijn website in PHP</label>
          <br>
        </p>
        <p>
          <label>Website titel:
          <input name="titel" type="text" id="titel">
          </label>
        </p>
        <p>
          <label>Website onderwerp:
          <input name="onderwerp" type="text" id="onderwerp">
          </label>
        </p>
        <p>
          <label>
          <input name="regdomeinnaam" type="checkbox" id="regdomeinnaam" value="regdomeinnaam">
          Registreer een domeinnaam (zoals bijvoorbeeld <em>*.nl</em>) en webruimte</label>
        </p>
        <p>
          <label>Gewenste domeinnaam:
          <input name="gewdomeinnaam" type="text" id="gewdomeinnaam">
          </label>
        </p>
        <p>
          <label>
          <input name="zend" type="submit" id="zend" value="Verzend">
          </label>
        </p>
        <p>&nbsp;</p>
        </form>
      </div></td>
  </tr>
</table>
<!-- End ImageReady Slices -->
<map name="Map">
  <area shape="rect" coords="19,91,145,114" href="*.html" target="_self">
  <area shape="rect" coords="22,132,146,154" href="*.html" target="_self">
  <area shape="rect" coords="21,172,145,193" href="*.html" target="_self">
  <area shape="rect" coords="21,212,145,232" href="*.html" target="_self">
  <area shape="rect" coords="19,251,144,273" href="*.html" target="_self">
</map>
</body>
</html>



ik heb al op internet gezocht en in de reacties bij Youtube gekeken, maar ik word er niet wijzer van.
Gewijzigd op 01/01/1970 01:00:00 door Hidde van Koningsveld
 
PHP hulp

PHP hulp

07/05/2024 17:17:52
 
Douwe

Douwe

18/08/2008 11:13:00
Quote Anchor link
Hoe kom jij aan $email etc.? En geen heredocs gebruiken!
 
Loran DP

Loran DP

18/08/2008 11:13:00
Quote Anchor link
zet even alles tussen code tags
 
Hidde van Koningsveld

Hidde van Koningsveld

18/08/2008 11:20:00
Quote Anchor link
volgens de tutorial maakte het niet uit hoe ik de variabelen noemde, als ik ze maar in het hele php file steeds hetzelfde gebruikte. Wat zijn heredocs?
 
Erwin Nieuwenhuis

Erwin Nieuwenhuis

18/08/2008 11:24:00
 
Hidde van Koningsveld

Hidde van Koningsveld

18/08/2008 11:27:00
Quote Anchor link
bedoel je met heredocs dat er html in php staat?
 
Hidde van Koningsveld

Hidde van Koningsveld

18/08/2008 11:29:00
Quote Anchor link
of die <<
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?
 
Douwe

Douwe

18/08/2008 11:34:00
Quote Anchor link
Heredoces zijn <<< inderdaad. Je kunt veel beter een gewone string gebruiken, of (nog beter) de HTML uit de PHP halen.
En hoe je variablen noemt is natuurlijk wel belangrijk, want anders weet PHP niet welke variable je bedoelt. Je moet bij het definieren en het oproepen van een variable de zelfde variablenaam gebruiken.

En bumpen mag niet.
 
Hidde van Koningsveld

Hidde van Koningsveld

18/08/2008 11:43:00
Quote Anchor link
het enige wat ik gedaan heb is de variablenamen veranderd en hij doet het!

in de tutorial hadden ze gewoon een fout gemaakt.

toch bedankt!
 
Douwe

Douwe

18/08/2008 11:45:00
Quote Anchor link
Goedzo :) Maar als je goed PHP wilt leren raad ik je aan Heredoc ook weg te gooien ;)
 
Hidde van Koningsveld

Hidde van Koningsveld

18/08/2008 11:50:00
Quote Anchor link
oke, doe ik in mijn volgende script, dit was namelijk alleen de offerte pagina, er komt ook nog een contactpagina ;)
 
Douwe

Douwe

18/08/2008 11:50:00
Quote Anchor link
Okay :)
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.