Bonjour à tous, je suis plutôt débutant en PHP & HTML et j'ai, plus ou moins, réussi à réaliser une page permettant de réaliser un devis. L'utilisateur sélectionne ce dont il a besoin et le tarif s'affiche en bas de page. J'aimerais pouvoir obtenir par mail les éléments qu'il a sélectionné ainsi que son adresse mail qu'il saisirait dans un champ différent. Mais c'est là que je bug et ne trouve pas du tout la solution. Toute aide serait bien évidemment plus que la bienvenue !

Merci à tous

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<script type="text/javascript"> 
 
// Calculate the total for items in the form which are selected. 
function calculateTotal(inputItem) 
{ 
with (inputItem.form) 
{ 
// Process each of the different input types in the form. 
if (inputItem.type == "radio") 
{ // Process radio buttons. 
 
// Subtract the previously selected radio button value from the total. 
calculatedTotal.value = eval(calculatedTotal.value) - eval(previouslySelectedRadioButton.value); 
 
// Save the current radio selection value. 
previouslySelectedRadioButton.value = eval(inputItem.value); 
 
// Add the current radio button selection value to the total. 
calculatedTotal.value = eval(calculatedTotal.value) + eval(inputItem.value); 
} 
 
else 
{ // Process check boxes. 
if (inputItem.checked == false) 
{ // Item was uncheck. Subtract item value from total. 
calculatedTotal.value = eval(calculatedTotal.value) - eval(inputItem.value); 
} 
 
else 
{ // Item was checked. Add the item value to the total. 
calculatedTotal.value = eval(calculatedTotal.value) + eval(inputItem.value); 
} 
} 
 
// Total value should never be less than 0. 
if (calculatedTotal.value < 0) { 
InitForm(); 
} 
 
// Return total value. 
return(formatCurrency(calculatedTotal.value)); 
} 
} 
 
// Format a value as currency. 
function formatCurrency(num) { 
num = num.toString().replace(/\$|\,/g,''); 
if(isNaN(num)) 
num = "0"; 
sign = (num == (num = Math.abs(num))); 
num = Math.floor(num*100+0.50000000001); 
cents = num%100; 
num = Math.floor(num/100).toString(); 
if(cents<10) 
cents = "0" + cents; 
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) 
num = num.substring(0,num.length-(4*i+3)) + ',' + num.substring(num.length-(4*i+3)); 
return (((sign)?'':'-') + '€' + num + '.' + cents); 
} 
 
// This function initialzes all the form elements to default values. 
function InitForm() { 
// Reset values on form. 
document.selectionForm.total.value='€0'; 
document.selectionForm.calculatedTotal.value=0; 
document.selectionForm.previouslySelectedRadioButton.value=0; 
 
// Set all checkboxes and radio buttons on form to unchecked. 
for (i=0; i < document.selectionForm.elements.length; i++) { 
if (document.selectionForm.elements[i].type == 'checkbox' | document.selectionForm.elements[i].type == 'radio') { 
document.selectionForm.elements[i].checked = false; 
} 
} 
} 
</script> 
 
</head> 
<body onload="InitForm();" onreset="InitForm();"> 
<div> 
<table><tr><td> 
<form method="POST" name="selectionForm"> 
<a href="../img/diametre_bobines.jpg" rel="lightbox"><img src="../img/encart_numerisation_tarifs.jpg" alt="" name="" width="469" height="53" border="0"/></a><br /> 
<b> 
<input type="checkbox" name="Montage K7 récente" value="29.00" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/montage.jpg" rel="lightbox"> Montage + DVD (DV, VHS, DVD, Disque Dur ou Carte Mémoire) par session de 2H</a></b><br> 
<br /> 
<b><input type="checkbox" name="Montage K7 ancienne" value="79.00" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/montage.jpg" rel="lightbox"> Montage + DVD (Hi-8, Vidéo 8 ou Digital 8) par session de 2H </a></b><br /> 
<br /> 
<a href="../img/diametre_bobines.jpg" rel="lightbox"><img src="../img/encart_produits_tarifs.jpg" alt="" name="" width="469" height="53" border="0"/></a><br /> 
<b> 
<input type="checkbox" name="DVD Supplementaire" value="9.00" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/DVD.jpg" rel="lightbox">DVD Supplémentaire </a></b><br /> 
<br /> 
<b> <input type="checkbox" name="Album photo" value="39.00" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/albumphoto.jpg" rel="lightbox">Album Photos de 20 pages - Grand format </a><br /> 
</b> 
<br /> 
<b><input type="checkbox" name="Clé USB" value="19.00" onclick="this.form.total.value=calculateTotal(this);"><a href="../img/produits_associes/usb.jpg" rel="lightbox"> Film sur clé USB de 2go et mise en ligne sur Viméo </a><br /> 
</b> <br /> 
<b><input type="checkbox" name="Tapis de souris" value="19.00" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/tapis.jpg" rel="lightbox">Tapis de souris personnalisé </a></b><br /> 
<br /> 
</td></tr></table> 
<br /> 
<b><a href="../img/diametre_bobines.jpg" rel="lightbox"><img src="../img/encart_bobines_tarifs.jpg" alt="" name="" width="469" height="53" border="0"/></a></b> 
<table><tr><td> 
<form method="POST" name="selectionForm"> 
<b><input type="checkbox" name="Taille 1" value="60.00" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/bobines.jpg" rel="lightbox"> Bobine de taille 1 </a></b><br> 
<br /> 
<b><input type="checkbox" name="Taille 2" value="70.00" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/bobines.jpg" rel="lightbox">Bobine de taille 2 </a></b><br /> 
<br /> 
<b><input type="checkbox" name="Taille 3" value="89.90" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/bobines.jpg" rel="lightbox">Bobine de taille 3</a> </b><br /> 
<br /> 
<b> <input type="checkbox" name="Taille 4" value="99.00" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/bobines.jpg" rel="lightbox">Bobine de taille 4</a><br /></b> 
<br /> 
<b><input type="checkbox" name="Taille 5" value="132.90" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/bobines.jpg" rel="lightbox">Bobine de taille 5</a><br /> 
</b> <br /> 
<b><input type="checkbox" name="Taille 6" value="166.00" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/bobines.jpg" rel="lightbox">Bobine de taille 6</a></b><br /> 
<br /> 
</td></tr></table> 
 
<br /> 
<b><a href="../img/diametre_bobines.jpg" rel="lightbox"><img src="../img/encart_bobines_tarifs2.jpg" alt="" name="" width="469" height="53" border="0" /></a></b> 
<table><tr><td> 
<form method="POST" name="selectionForm"> 
<b><input type="checkbox" name="Taille 1" value="60.00" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/bobines.jpg" rel="lightbox">Bobine de taille 1 </a></b><br> 
<br /> 
<b><input type="checkbox" name="Taille 2" value="70.00" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/bobines.jpg" rel="lightbox">Bobine de taille 2</a></b><br /> 
<br /> 
<b><input type="checkbox" name="Taille 3" value="95.90" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/bobines.jpg" rel="lightbox">Bobine de taille 3 </a></b><br /> 
<br /> 
<b> <input type="checkbox" name="Taille 4" value="109.00" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/bobines.jpg" rel="lightbox">Bobine de taille 4</a><br /></b> 
<br /> 
<b><input type="checkbox" name="Taille 5" value="149.90" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/bobines.jpg" rel="lightbox">Bobine de taille 5</a><br /> 
</b> <br /> 
<b><input type="checkbox" name="Taille 6" value="157.90" onclick="this.form.total.value=calculateTotal(this);"> <a href="../img/produits_associes/bobines.jpg" rel="lightbox">Bobine de taille 6</a></b><br /> 
<br /> 
</td></tr></table> 
 
</div> 
<div><table><tr> 
<td><p><br> 
<b>Participation aux frais de livraison via notre prestataire UPS</b><br> 
<input name="service" type="radio" onclick="this.form.total.value=calculateTotal(this);" value="15.00" checked="CHECKED"> 
15€ <br> 
<br> 
 
<input type="hidden" name="calculatedTotal" value="0"> 
<input type="hidden" name="previouslySelectedRadioButton" value="0"> 
<strong>Votre montant total sera:</strong> 
 
<input type="text" name="total" readonly onfocus="this.blur();" id="total"> 
 
<strong><br /> 
<br /> 
Si vous souhaitez nous faire parvenir ce devis, indiquez votre adresse email et nous vous recontacerons sous 24H.</strong><br /> 
<form action="formulaire_mailhome.php" method="post" enctype="multipart/form-data" name="monformulaire" target="_blank" id="monformulaire2"> 
<input name="adressemail" type="text" value="" /> 
<br /> 
<input type="submit" value="envoyer" /> 
</form> 
<br /> 
<br /> 
</p> 
 
 
<p> 
</form>