Formulaire html
phil
-
phil -
phil -
Bonjour,
j ai créé un petit formulaire html pour les besoin de ma boite, cependant je n arrive pas à ce que les données puissent etre sauvegarder ( svg individuel de chaque formulaire) voir a l envoyer. En effet la commande form effectivement ouvre le mail du destinataire mais je ne peux rattacher le formulaire. J ai navigué sur les forum, la solution est apparament un petit prog php ou autre mais je ni arrive pas !! marci pour votre aide !! voici le script !!
je sais c est un peu long, le copier sur le bloc note pour voir ce que ca donne en format html biensur !
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
var menu=new CreerMenu(3,"Centre Opérationnel","Agence","Unité","titre 4","_blank");
// CreerMenu(Nb de listes, titre1, titre2, titre3, target)
// Nb listes=4 maxi
// Les 4 titres sont obligatoires (meme si Nb_liste<4)
// target=nom de la frame ou "self" si c'est la fenetre elle meme, "_blank" pour une nouvelle
// Pour ajouter les liens dans les listes, utiliser menu.Add
menu.Add(1,"Aude-PO","");
menu.Add(2,"11-Aude","");
menu.Add(3,"09 - Prestation recurrentes hors DSP");
menu.Add(3,"11 - Zac Narbonne");
menu.Add(3,"12 - Narbonne ville");
menu.Add(3,"13 - biotera usine compost");
menu.Add(3,"14 - Narbonne plage EAU et reseau EU");
menu.Add(3,"15 - Narbonne plage EU");
menu.Add(3,"17 - CA de Narbonne");
menu.Add(3,"20 - Unité Etang sud audois");
menu.Add(3,"50 - Unité corbière minervois");
menu.Add(3,"70 - Carcassonne")
menu.Add(2,"12-Perpignan","");
menu.Add(3,"09 - Prestation recurrentes hors DSP");
menu.Add(3,"21 - Perpignan AEP");
menu.Add(3,"25 - Agglo AEP");
menu.Add(3,"31 - Perpignan Asst");
menu.Add(3,"35 - Agglo Asst");
menu.Add(3,"36 - Sud Roussillon")
menu.Add(2,"13-Catalogne","")
menu.Add(3,"09 - Prestation recurrentes hors DSP");
menu.Add(3,"21 - Unité tech aval District Cote Vermeille");
menu.Add(3,"23 - Unite tech aval SI Basse plaine du tech");
menu.Add(3,"30 - Unité tech amont");
menu.Add(3,"51 - Unité vallée de l aggly");
menu.Add(3,"52 - Sivom Leucate Barcares")
menu.Add(1,"Herault-Cevenne","");
menu.Add(2,"21-Montpellier","");
menu.Add(3,"09 - Prestation recurrentes hors DSP");
menu.Add(3,"10 - Montpellier Eau potable");
menu.Add(3,"11 - Montpellier réseau eau");
menu.Add(3,"12 - Montpellier fontaines");
menu.Add(3,"14 - Montpellier Production");
menu.Add(3,"16 - Agglo montpellier eau potable");
menu.Add(3,"20 - Montpellier Asst");
menu.Add(3,"21 - CA de Montpellier épuration céreirède");
menu.Add(3,"22 - CA de Montpellier réseau ville de Mtp");
menu.Add(3,"24 - CA Montpellier");
menu.Add(2,"22-Herault-Cevenne","");
menu.Add(3,"09 - Prestation recurrentes hors DSP");
menu.Add(3,"40 - Unité Nord");
menu.Add(3,"50 - Unité littoral TCE (T)");
menu.Add(3,"51 - Unité littoral");
menu.Add(3,"52 - Sète");
menu.Add(1,"Est-Nord","");
menu.Add(2,"31-Gard-Drome-Ardeche","");
menu.Add(3,"09 - Prestation recurrentes hors DSP");
menu.Add(3,"10 - Costière");
menu.Add(3,"11 - Beaucaire/Aramon ");
menu.Add(3,"12 - StGillesGard/Beauvoisin/Generac");
menu.Add(3,"13 - Ca nimes metro/Sivom Bezouce-st gervasy/Meynes/...");
menu.Add(3,"20 - Portes de Provence");
menu.Add(3,"21 - Drome - Ardèche");
menu.Add(3,"22 - Vallon pont d arc/lagorce");
menu.Add(3,"23 - Unité Gard rhodanien");
menu.Add(3,"24 - Nyons");
menu.Add(3,"30 - Cévennes");
menu.Add(3,"31 - Chauffage");
menu.Add(3,"32 - CevennesAEP/avene eau si/StMartin eau/Salindres eau/...");
menu.Add(3,"33 - StMartin/Salindres/Mons/StPrivat/Ribautes/StChristol/...");
menu.Add(3,"34 - asst CGE / Uzes");
menu.Add(2,"32-Aveyron-Lozere","");
menu.Add(3,"09 - Prestation recurrentes hors DSP");
menu.Add(3,"10 - Unité Aveyron Ouest");
menu.Add(3,"11 - Liort Jaoul/Rives Tarn");
menu.Add(3,"12 - Carlade eau/StHippolyte");
menu.Add(3,"13 - Capdenac/Firmi/aubin/decazeville/Conques");
menu.Add(3,"20 - Unité Rodez");
menu.Add(3,"21 - asst convention deversement");
menu.Add(3,"22 - Rodez ville");
menu.Add(3,"23 - Luc la primaude");
menu.Add(3,"24 - Step Cantarane");
menu.Add(3,"40 - Unité Aveyron Est");
menu.Add(3,"41 - Millau");
menu.Add(3,"46 - Les costes gozons/Ste affrique");
menu.Add(3,"60 - Unité Lozère");
menu.Add(3,"62 - Mende");
menu.Add(3,"63 - Langogne/Clamouse/Chastanier");
menu.Add(3,"64 - Florac/Bedoues/Cocures/Quezac");
menu.Add(3,"65 - StChely/SI fontbelle/SIAP Peyrebesse/Albaret le comtal");
menu.Add(3,"66 - StAlban/Albaret ste marie/Blavignac");
function CreerMenu(profondeur,titre1,titre2,titre3,titre4,target) {
this.nb=0;this.prof=profondeur;
this.titre1=titre1; this.titre2=titre2; this.titre3=titre3; this.titre4=titre4; this.target=target
this.Add=AddObjet;
this.Aff=AffMenu;
}
function AddObjet(deep,txt,page) {
var rub = new Object;
rub.deep=deep;
rub.txt=txt;
rub.page=page;
this[this.nb]=rub;
this.nb++;
}
function AffMenu() {
var Z="<FORM name='mf'>";
Z+="<SELECT size=1 name='list1' onChange='Clic(1)'><OPTION selected>"+this.titre1+"</OPTION>";
for (var i=0;i<this.nb;i++) {
if (this[i].deep==1) {
Z+="<OPTION value='"+i+"'>"+this[i].txt+"</OPTION>"
}
}
Z+="</SELECT>";
for (var i=2;i<=menu.prof;i++) {
Z+="<SELECT name='list"+i+"' onChange='Clic("+i+")'><OPTION>"+eval("menu.titre"+i)+"</OPTION><OPTION></OPTION><OPTION></OPTION><OPTION></OPTION><OPTION></OPTION><OPTION></OPTION></SELECT>";
}
Z+="</FORM>";
document.write(Z);
}
function add() {
var c=new Option("ADD","",true,true);
document.forms[0].elements["list"].options[0]=c;
}
function Clic(no) {
var valeur=document.forms["mf"].elements["list"+no].options[ document.forms["mf"].elements["list"+no].selectedIndex].value;
if ((valeur!="")&&(valeur!=null)&&(no<menu.prof)) {
var deep=menu[valeur].deep;
var no2=1;
for (var noX=(no+1);noX<=menu.prof;noX++) {
document.forms["mf"].elements["list"+eval(noX)].options.length=0;
var titre=eval("menu.titre"+noX);
var c=new Option(titre);
document.forms["mf"].elements["list"+(noX)].options[0]=c;
document.forms["mf"].elements["list"+(noX)].selectedIndex=0;
}
valeur++;
for (var i=valeur;i<menu.nb;i++) {
//alert(i);
if (menu[i].deep==deep+1) {
//alert("no="+no+" texte="+menu[i].txt);
var c=new Option(menu[i].txt,i);
document.forms["mf"].elements["list"+(no+1)].options[no2]=c;
no2++;
} else { if (menu[i].deep==deep){i=menu.nb;}}
}
document.forms["mf"].elements["list"+(no+1)].options.length=no2+1;
document.forms["mf"].elements["list"+(no+1)].selectedIndex=0;
Clic(no+1)
valeur--;
}
if ((valeur!="")&&(valeur!=null)) {
var page=menu[valeur].page;
if ((page!="")&&(page!=null)) {
if (menu.target=="self") {window.location=page}
else if (menu.target=="_blank") {window.open(page,"","menubar,scrollbars,toolbar,status,location")}
else {parent.frames[menu.target].location.href=page;}
}
}
}
// Fonctions destinées à afficher l'arborescence du menu
function space(i) {var Z="";for (var j=0;j<i;j++){Z+=" ";}return Z}
function Arbo(m) {
var Z="<BR>";
for (var i=0;i<m.nb;i++) {
Z+=space(m[i].deep)+m[i].txt+" <A href='"+m[i].page+"'>"+m[i].page+"</A><BR>"
}
document.write(Z);
}
</SCRIPT>
</head>
<body>
<table border="0" width="100%" align="center">
<tr>
<td width="15%" align="center""><img src="logo.jpg"></td>
<td width="85%" align="center">
<P>
<p>
<p>
<p>
<font face="arial" font size="3">
<b>FICHE D OUVERTURE DE CHANTIER INDIVIDUALISE</b><br></font>
<font face="arial" font size="1">
( à retourner au service comptabilité à l'attention de<br>
bidule ou schmoll Tel 04 67 20 49 08 Fax 04 67 20 73 56</font>
</td>
</tr>
</table>
<table border="0" width="100%" align="center">
<tr>
<p>
<td width="45%">DEMANDEUR</td>
<td width="55%"><input type="texte" size="20" name="demandeur"></td
</tr>
<tr>
<td width="45%">DATE</td>
<td width="55%"><input type="texte" size="13" name="DATE"></td
</tr>
<tr>
<td width="45%">N° FAX OU RETOURNER LA DEMANDE</td>
<td width="55%"><input type="texte" size="13" name="fax"></td
</tr>
</table>
<table border="0" width="100%" align="center">
<tr>
<p>
<td "width="45%">SOCIETE</td>
<td width="55%">
<select size="1" name="societe">
<option> </option>
<option>S0002 - CGE</option>
<option>SX115 - SADE</option>
<option>S0101 - CEO</option>
<option>S0164 - SME</option>
<option>S0116 - SRDE</option>
<option>S0001 - VIVENDI</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<SCRIPT LANGUAGE="JavaScript">
menu.Aff();
</SCRIPT>
</td>
</tr>
</table>
<table border="0" width="100%" align="center">
<form action='mailto:bidule@bidule.fr' method="post">
<tr>
<td width="45%">CONTRAT</td>
<td width="55%"><input type="texte" size="5" name="contrat"></td>
</tr>
<TR>
<p>
<td width="45%">DESIGNATION DES TRAVAUX</td>
<td width="55%"><input type="texte" size="50" name="designation"></td>
</tr>
<tr>
<td width="45%">TYPE</td>
<td width="55%">
<select size="1" name="lettre">
<option> </option>
<option>T - ijt travaux facturables</option>
<option>C - ijt canalisation eau</option>
<option>D - ijt canalisation asst</option>
<option>B - ijt branchement eau</option>
<option>A - ijt branchement asst</option>
<option>G - ijt génie civil eau</option>
<option>H - ijt génie civil asst</option>
<option>E - ijt électroméca eau</option>
<option>F - ijt électroméca asst</option>
<option>X - ijt divers eau</option>
<option>Y - ijt divers asst</option>
<option>Z - ijt autres activités</option>
<option>W - product immo domaine privé</option>
</select></td>
</tr>
<tr>
<td width="45%">NATURE</td>
<td width="55%">
<select size="1" name="nature">
<option> </option>
<option>2 - TCE</option>
<option>3 - TSE</option>
<option>5 - TEP</option>
<option>6 - ijt 1er établissement</option>
<option>7 - ijt renouvellement</option>
<option>8 - produc immob domaine privé </option>
</select></td>
</tr>
<TR>
<td width="45%">S'AGIT IL DE TRAVAUX DE PROXIMITE ?</td>
<td width="55%"><input type="radio" name="option" value="option a"> oui <input type="radio" name="option" value="option b"> non </td>
</tr>
</table>
<table border="0" width="100%" align="center">
<tr>
<p>
<td width="45%">MONTANT PREVU DES PRODUITS ?(type T)</td>
<td width="55%"><input type="texte" size="10" name="produit"></td>
</tr>
<tr>
<td width="45%">MONTANT PREVU DES DEPENSES ?(tout type)</td>
<td width="55%"><input type="texte" size="10" name="depense"></td
</tr>
<tr>
<td width="45%">NUMERO DE PROJET</td>
<td width="55%"><input type="texte" size="5" name="projet"></td
</tr>
<tr>
<td width="45%">FINANCEMENT PAR </td>
<td width="55%"><input type="texte" size="20" name="financement"></td
</tr>
<tr>
<td width="45%">DATE PREVISIONNELLE DEBUT TVX </td>
<td width="55%"><input type="texte" size="10" name="datedeb"></td
</tr>
<tr>
<td width="45%">DATE DE FIN TVX </td>
<td width="55%"><input type="texte" size="10" name="datefin"></td
</tr>
</table>
<table border="1" width="100%" align="center">
<tr>
<p>
<p>
<b>( Cadre réservé à la direction )</b>
<td width="45%">NUMERO DE CHANTIER </td>
<td width="55%"><input type="texte" size="13" name="chantier"></td
</tr>
<tr>
<td width="45%">DATE D OUVERTURE </td>
<td width="55%"><input type="texte" size="13" name="dateouv"></td
</tr>
<tr>
<td width="45%">CREATEUR DU CHANTIER </td>
<td width="55%"><select size="1" name="nom">
<option> </option>
<option>P.</option>
<option>JP</option>
<option>E</option>
<option>P</option>
</select></td>
</tr>
</table>
<p>
<table width="100%" align="center">
<tr>
<td width="50%" align="center">
<input type="reset" value="EFFACER"></td>
<td width="50%" align="center">
<input type="submit" value="ENVOYER"></td>
</tr>
</table>
</form>
</body>
</html>
j ai créé un petit formulaire html pour les besoin de ma boite, cependant je n arrive pas à ce que les données puissent etre sauvegarder ( svg individuel de chaque formulaire) voir a l envoyer. En effet la commande form effectivement ouvre le mail du destinataire mais je ne peux rattacher le formulaire. J ai navigué sur les forum, la solution est apparament un petit prog php ou autre mais je ni arrive pas !! marci pour votre aide !! voici le script !!
je sais c est un peu long, le copier sur le bloc note pour voir ce que ca donne en format html biensur !
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
var menu=new CreerMenu(3,"Centre Opérationnel","Agence","Unité","titre 4","_blank");
// CreerMenu(Nb de listes, titre1, titre2, titre3, target)
// Nb listes=4 maxi
// Les 4 titres sont obligatoires (meme si Nb_liste<4)
// target=nom de la frame ou "self" si c'est la fenetre elle meme, "_blank" pour une nouvelle
// Pour ajouter les liens dans les listes, utiliser menu.Add
menu.Add(1,"Aude-PO","");
menu.Add(2,"11-Aude","");
menu.Add(3,"09 - Prestation recurrentes hors DSP");
menu.Add(3,"11 - Zac Narbonne");
menu.Add(3,"12 - Narbonne ville");
menu.Add(3,"13 - biotera usine compost");
menu.Add(3,"14 - Narbonne plage EAU et reseau EU");
menu.Add(3,"15 - Narbonne plage EU");
menu.Add(3,"17 - CA de Narbonne");
menu.Add(3,"20 - Unité Etang sud audois");
menu.Add(3,"50 - Unité corbière minervois");
menu.Add(3,"70 - Carcassonne")
menu.Add(2,"12-Perpignan","");
menu.Add(3,"09 - Prestation recurrentes hors DSP");
menu.Add(3,"21 - Perpignan AEP");
menu.Add(3,"25 - Agglo AEP");
menu.Add(3,"31 - Perpignan Asst");
menu.Add(3,"35 - Agglo Asst");
menu.Add(3,"36 - Sud Roussillon")
menu.Add(2,"13-Catalogne","")
menu.Add(3,"09 - Prestation recurrentes hors DSP");
menu.Add(3,"21 - Unité tech aval District Cote Vermeille");
menu.Add(3,"23 - Unite tech aval SI Basse plaine du tech");
menu.Add(3,"30 - Unité tech amont");
menu.Add(3,"51 - Unité vallée de l aggly");
menu.Add(3,"52 - Sivom Leucate Barcares")
menu.Add(1,"Herault-Cevenne","");
menu.Add(2,"21-Montpellier","");
menu.Add(3,"09 - Prestation recurrentes hors DSP");
menu.Add(3,"10 - Montpellier Eau potable");
menu.Add(3,"11 - Montpellier réseau eau");
menu.Add(3,"12 - Montpellier fontaines");
menu.Add(3,"14 - Montpellier Production");
menu.Add(3,"16 - Agglo montpellier eau potable");
menu.Add(3,"20 - Montpellier Asst");
menu.Add(3,"21 - CA de Montpellier épuration céreirède");
menu.Add(3,"22 - CA de Montpellier réseau ville de Mtp");
menu.Add(3,"24 - CA Montpellier");
menu.Add(2,"22-Herault-Cevenne","");
menu.Add(3,"09 - Prestation recurrentes hors DSP");
menu.Add(3,"40 - Unité Nord");
menu.Add(3,"50 - Unité littoral TCE (T)");
menu.Add(3,"51 - Unité littoral");
menu.Add(3,"52 - Sète");
menu.Add(1,"Est-Nord","");
menu.Add(2,"31-Gard-Drome-Ardeche","");
menu.Add(3,"09 - Prestation recurrentes hors DSP");
menu.Add(3,"10 - Costière");
menu.Add(3,"11 - Beaucaire/Aramon ");
menu.Add(3,"12 - StGillesGard/Beauvoisin/Generac");
menu.Add(3,"13 - Ca nimes metro/Sivom Bezouce-st gervasy/Meynes/...");
menu.Add(3,"20 - Portes de Provence");
menu.Add(3,"21 - Drome - Ardèche");
menu.Add(3,"22 - Vallon pont d arc/lagorce");
menu.Add(3,"23 - Unité Gard rhodanien");
menu.Add(3,"24 - Nyons");
menu.Add(3,"30 - Cévennes");
menu.Add(3,"31 - Chauffage");
menu.Add(3,"32 - CevennesAEP/avene eau si/StMartin eau/Salindres eau/...");
menu.Add(3,"33 - StMartin/Salindres/Mons/StPrivat/Ribautes/StChristol/...");
menu.Add(3,"34 - asst CGE / Uzes");
menu.Add(2,"32-Aveyron-Lozere","");
menu.Add(3,"09 - Prestation recurrentes hors DSP");
menu.Add(3,"10 - Unité Aveyron Ouest");
menu.Add(3,"11 - Liort Jaoul/Rives Tarn");
menu.Add(3,"12 - Carlade eau/StHippolyte");
menu.Add(3,"13 - Capdenac/Firmi/aubin/decazeville/Conques");
menu.Add(3,"20 - Unité Rodez");
menu.Add(3,"21 - asst convention deversement");
menu.Add(3,"22 - Rodez ville");
menu.Add(3,"23 - Luc la primaude");
menu.Add(3,"24 - Step Cantarane");
menu.Add(3,"40 - Unité Aveyron Est");
menu.Add(3,"41 - Millau");
menu.Add(3,"46 - Les costes gozons/Ste affrique");
menu.Add(3,"60 - Unité Lozère");
menu.Add(3,"62 - Mende");
menu.Add(3,"63 - Langogne/Clamouse/Chastanier");
menu.Add(3,"64 - Florac/Bedoues/Cocures/Quezac");
menu.Add(3,"65 - StChely/SI fontbelle/SIAP Peyrebesse/Albaret le comtal");
menu.Add(3,"66 - StAlban/Albaret ste marie/Blavignac");
function CreerMenu(profondeur,titre1,titre2,titre3,titre4,target) {
this.nb=0;this.prof=profondeur;
this.titre1=titre1; this.titre2=titre2; this.titre3=titre3; this.titre4=titre4; this.target=target
this.Add=AddObjet;
this.Aff=AffMenu;
}
function AddObjet(deep,txt,page) {
var rub = new Object;
rub.deep=deep;
rub.txt=txt;
rub.page=page;
this[this.nb]=rub;
this.nb++;
}
function AffMenu() {
var Z="<FORM name='mf'>";
Z+="<SELECT size=1 name='list1' onChange='Clic(1)'><OPTION selected>"+this.titre1+"</OPTION>";
for (var i=0;i<this.nb;i++) {
if (this[i].deep==1) {
Z+="<OPTION value='"+i+"'>"+this[i].txt+"</OPTION>"
}
}
Z+="</SELECT>";
for (var i=2;i<=menu.prof;i++) {
Z+="<SELECT name='list"+i+"' onChange='Clic("+i+")'><OPTION>"+eval("menu.titre"+i)+"</OPTION><OPTION></OPTION><OPTION></OPTION><OPTION></OPTION><OPTION></OPTION><OPTION></OPTION></SELECT>";
}
Z+="</FORM>";
document.write(Z);
}
function add() {
var c=new Option("ADD","",true,true);
document.forms[0].elements["list"].options[0]=c;
}
function Clic(no) {
var valeur=document.forms["mf"].elements["list"+no].options[ document.forms["mf"].elements["list"+no].selectedIndex].value;
if ((valeur!="")&&(valeur!=null)&&(no<menu.prof)) {
var deep=menu[valeur].deep;
var no2=1;
for (var noX=(no+1);noX<=menu.prof;noX++) {
document.forms["mf"].elements["list"+eval(noX)].options.length=0;
var titre=eval("menu.titre"+noX);
var c=new Option(titre);
document.forms["mf"].elements["list"+(noX)].options[0]=c;
document.forms["mf"].elements["list"+(noX)].selectedIndex=0;
}
valeur++;
for (var i=valeur;i<menu.nb;i++) {
//alert(i);
if (menu[i].deep==deep+1) {
//alert("no="+no+" texte="+menu[i].txt);
var c=new Option(menu[i].txt,i);
document.forms["mf"].elements["list"+(no+1)].options[no2]=c;
no2++;
} else { if (menu[i].deep==deep){i=menu.nb;}}
}
document.forms["mf"].elements["list"+(no+1)].options.length=no2+1;
document.forms["mf"].elements["list"+(no+1)].selectedIndex=0;
Clic(no+1)
valeur--;
}
if ((valeur!="")&&(valeur!=null)) {
var page=menu[valeur].page;
if ((page!="")&&(page!=null)) {
if (menu.target=="self") {window.location=page}
else if (menu.target=="_blank") {window.open(page,"","menubar,scrollbars,toolbar,status,location")}
else {parent.frames[menu.target].location.href=page;}
}
}
}
// Fonctions destinées à afficher l'arborescence du menu
function space(i) {var Z="";for (var j=0;j<i;j++){Z+=" ";}return Z}
function Arbo(m) {
var Z="<BR>";
for (var i=0;i<m.nb;i++) {
Z+=space(m[i].deep)+m[i].txt+" <A href='"+m[i].page+"'>"+m[i].page+"</A><BR>"
}
document.write(Z);
}
</SCRIPT>
</head>
<body>
<table border="0" width="100%" align="center">
<tr>
<td width="15%" align="center""><img src="logo.jpg"></td>
<td width="85%" align="center">
<P>
<p>
<p>
<p>
<font face="arial" font size="3">
<b>FICHE D OUVERTURE DE CHANTIER INDIVIDUALISE</b><br></font>
<font face="arial" font size="1">
( à retourner au service comptabilité à l'attention de<br>
bidule ou schmoll Tel 04 67 20 49 08 Fax 04 67 20 73 56</font>
</td>
</tr>
</table>
<table border="0" width="100%" align="center">
<tr>
<p>
<td width="45%">DEMANDEUR</td>
<td width="55%"><input type="texte" size="20" name="demandeur"></td
</tr>
<tr>
<td width="45%">DATE</td>
<td width="55%"><input type="texte" size="13" name="DATE"></td
</tr>
<tr>
<td width="45%">N° FAX OU RETOURNER LA DEMANDE</td>
<td width="55%"><input type="texte" size="13" name="fax"></td
</tr>
</table>
<table border="0" width="100%" align="center">
<tr>
<p>
<td "width="45%">SOCIETE</td>
<td width="55%">
<select size="1" name="societe">
<option> </option>
<option>S0002 - CGE</option>
<option>SX115 - SADE</option>
<option>S0101 - CEO</option>
<option>S0164 - SME</option>
<option>S0116 - SRDE</option>
<option>S0001 - VIVENDI</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<SCRIPT LANGUAGE="JavaScript">
menu.Aff();
</SCRIPT>
</td>
</tr>
</table>
<table border="0" width="100%" align="center">
<form action='mailto:bidule@bidule.fr' method="post">
<tr>
<td width="45%">CONTRAT</td>
<td width="55%"><input type="texte" size="5" name="contrat"></td>
</tr>
<TR>
<p>
<td width="45%">DESIGNATION DES TRAVAUX</td>
<td width="55%"><input type="texte" size="50" name="designation"></td>
</tr>
<tr>
<td width="45%">TYPE</td>
<td width="55%">
<select size="1" name="lettre">
<option> </option>
<option>T - ijt travaux facturables</option>
<option>C - ijt canalisation eau</option>
<option>D - ijt canalisation asst</option>
<option>B - ijt branchement eau</option>
<option>A - ijt branchement asst</option>
<option>G - ijt génie civil eau</option>
<option>H - ijt génie civil asst</option>
<option>E - ijt électroméca eau</option>
<option>F - ijt électroméca asst</option>
<option>X - ijt divers eau</option>
<option>Y - ijt divers asst</option>
<option>Z - ijt autres activités</option>
<option>W - product immo domaine privé</option>
</select></td>
</tr>
<tr>
<td width="45%">NATURE</td>
<td width="55%">
<select size="1" name="nature">
<option> </option>
<option>2 - TCE</option>
<option>3 - TSE</option>
<option>5 - TEP</option>
<option>6 - ijt 1er établissement</option>
<option>7 - ijt renouvellement</option>
<option>8 - produc immob domaine privé </option>
</select></td>
</tr>
<TR>
<td width="45%">S'AGIT IL DE TRAVAUX DE PROXIMITE ?</td>
<td width="55%"><input type="radio" name="option" value="option a"> oui <input type="radio" name="option" value="option b"> non </td>
</tr>
</table>
<table border="0" width="100%" align="center">
<tr>
<p>
<td width="45%">MONTANT PREVU DES PRODUITS ?(type T)</td>
<td width="55%"><input type="texte" size="10" name="produit"></td>
</tr>
<tr>
<td width="45%">MONTANT PREVU DES DEPENSES ?(tout type)</td>
<td width="55%"><input type="texte" size="10" name="depense"></td
</tr>
<tr>
<td width="45%">NUMERO DE PROJET</td>
<td width="55%"><input type="texte" size="5" name="projet"></td
</tr>
<tr>
<td width="45%">FINANCEMENT PAR </td>
<td width="55%"><input type="texte" size="20" name="financement"></td
</tr>
<tr>
<td width="45%">DATE PREVISIONNELLE DEBUT TVX </td>
<td width="55%"><input type="texte" size="10" name="datedeb"></td
</tr>
<tr>
<td width="45%">DATE DE FIN TVX </td>
<td width="55%"><input type="texte" size="10" name="datefin"></td
</tr>
</table>
<table border="1" width="100%" align="center">
<tr>
<p>
<p>
<b>( Cadre réservé à la direction )</b>
<td width="45%">NUMERO DE CHANTIER </td>
<td width="55%"><input type="texte" size="13" name="chantier"></td
</tr>
<tr>
<td width="45%">DATE D OUVERTURE </td>
<td width="55%"><input type="texte" size="13" name="dateouv"></td
</tr>
<tr>
<td width="45%">CREATEUR DU CHANTIER </td>
<td width="55%"><select size="1" name="nom">
<option> </option>
<option>P.</option>
<option>JP</option>
<option>E</option>
<option>P</option>
</select></td>
</tr>
</table>
<p>
<table width="100%" align="center">
<tr>
<td width="50%" align="center">
<input type="reset" value="EFFACER"></td>
<td width="50%" align="center">
<input type="submit" value="ENVOYER"></td>
</tr>
</table>
</form>
</body>
</html>
A voir également:
- Formulaire html
- Whatsapp formulaire opposition - Guide
- Formulaire de réclamation facebook - Guide
- Editeur html - Télécharger - HTML
- Formulaire de reclamation instagram - Guide
- Espace html - Astuces et Solutions
3 réponses
Tu as la solution, mais tu ne semble pas savoir comment l'appliquer.
En fait, ton formulaire doit faire appel à un script PHP lors de l'execution (envoi). C'est ce script PHP là qui sera chargé de récupérer les informations de ton formulaire, et d'envoyer ledit formulaire par mail au correspondant adéquat.
Tes questions sont donc :
Comment récupérer les données du formulaire dans mon script PHP ?
-> cherche sur google tu trouvera très vite.
Comment appeller mon script PHP depuis mon formulaire lors de l'éxecution ?
-> Il faut pour cela que tu arrange ta balise <FORM> comme suit (si ton script PHP se nomme 'script.php') :
<form action="script.php" method="POST">
...
</form>
Comment faire pour envoyer un mail dans mon script PHP une fois mes informations récupérées ?
-> Pour ca, tu peux utiliser la classe php dont voici le code (Merci à l'auteur dont je ne me souviens plus du nom :s) :
L'utilisation de cette classe se fait de la manière suivante :
Ta fonction s'utilise en passant en paramètre l'adresse mail de l'envoyeur et celle du destinataire, ainsi que le chemin d'acces au fichier que tu souhaite envoyer en pièce jointe.
Pour pouvoir utiliser la "bibliothèque" Mail.class.php, il faut l'inclure dans ton script PHP de la facon suivante :
A mettre au début du script PHP.
Voilà, je pense que tu as toutes les informations utiles pour pouvoir réaliser ton projet.
Bon courage pour la mise en place :)
En fait, ton formulaire doit faire appel à un script PHP lors de l'execution (envoi). C'est ce script PHP là qui sera chargé de récupérer les informations de ton formulaire, et d'envoyer ledit formulaire par mail au correspondant adéquat.
Tes questions sont donc :
Comment récupérer les données du formulaire dans mon script PHP ?
-> cherche sur google tu trouvera très vite.
Comment appeller mon script PHP depuis mon formulaire lors de l'éxecution ?
-> Il faut pour cela que tu arrange ta balise <FORM> comme suit (si ton script PHP se nomme 'script.php') :
<form action="script.php" method="POST">
...
</form>
Comment faire pour envoyer un mail dans mon script PHP une fois mes informations récupérées ?
-> Pour ca, tu peux utiliser la classe php dont voici le code (Merci à l'auteur dont je ne me souviens plus du nom :s) :
<?php class Mail { var $sendto= array(); var $from, $msubject; var $acc= array(); var $abcc= array(); var $aattach= array(); var $priorities= array( '1 (Highest)', '2 (High)', '3 (Normal)', '4 (Low)', '5 (Lowest)' ); // Mail contructor function Mail() { $this->autoCheck( true ); } /* autoCheck( $boolean ) * activate or desactivate the email addresses validator * ex: autoCheck( true ) turn the validator on * by default autoCheck feature is on */ function autoCheck( $bool ) { if( $bool ) $this->checkAddress = true; else $this->checkAddress = false; } /* Subject( $subject ) * define the subject line of the email * $subject: any valid mono-line string */ function Subject( $subject ) { $this->msubject = strtr( $subject, "\r\n" , " " ); } /* From( $from ) * set the sender of the mail * $from should be an email address */ function From( $from ) { if( ! is_string($from) ) { echo "Class Mail: Erreur, From n'est pas de la bonne forme"; exit; } $this->from= $from; } /* To( $to ) * set the To ( recipient ) * $to : email address, accept both a single address or an array of addresses */ function To( $to ) { // TODO : test validité sur to if( is_array( $to ) ) $this->sendto= $to; else $this->sendto[] = $to; if( $this->checkAddress == true ) $this->CheckAdresses( $this->sendto ); } /* Cc() * set the CC headers ( carbon copy ) * $cc : email address(es), accept both array and string */ function Cc( $cc ) { if( is_array($cc) ) $this->acc= $cc; else $this->acc[]= $cc; if( $this->checkAddress == true ) $this->CheckAdresses( $this->acc ); } /* Bcc() * set the Bcc headers ( blank carbon copy ). * $bcc : email address(es), accept both array and string */ function Bcc( $bcc ) { if( is_array($bcc) ) { $this->abcc = $bcc; } else { $this->abcc[]= $bcc; } if( $this->checkAddress == true ) $this->CheckAdresses( $this->abcc ); } /* Body() * set the body of the mail ( message ) */ function Body( $body ) { $this->body= $body; } /* Send() * fornat and send the mail */ function Send() { // build the headers $this->_build_headers(); // include attached files if( sizeof( $this->aattach > 0 ) ) { $this->_build_attachement(); $body = $this->fullBody . $this->attachment; } // envoie du mail aux destinataires principaux for( $i=0; $i< sizeof($this->sendto); $i++ ) { $res = mail($this->sendto[$i], $this->msubject,$body, $this->headers); // TODO : trmt res } } /* Organization( $org ) * set the Organisation header */ function Organization( $org ) { if( trim( $org != "" ) ) $this->organization= $org; } /* Priority( $priority ) * set the mail priority * $priority : integer taken between 1 (highest) and 5 ( lowest ) * ex: $m->Priority(1) ; => Highest */ function Priority( $priority ) { if( ! intval( $priority ) ) return false; if( ! isset( $this->priorities[$priority-1]) ) return false; $this->priority= $this->priorities[$priority-1]; return true; } /* Attach( $filename, $filetype ) * attach a file to the mail * $filename : path of the file to attach * $filetype : MIME-type of the file. default to 'application/x-unknown-content-type' * $disposition : instruct the Mailclient to display the file if possible ("inline") or always as a link ("attachment") * possible values are "inline", "attachment" */ function Attach( $filename, $filetype='application/x-unknown-content-type', $disposition = "inline" ) { // TODO : si filetype="", alors chercher dans un tablo de MT connus / extension du fichier $this->aattach[] = $filename; $this->actype[] = $filetype; $this->adispo[] = $disposition; } /* Get() * return the whole e-mail , headers + message * can be used for displaying the message in plain text or logging it */ function Get() { $this->_build_headers(); if( sizeof( $this->aattach > 0 ) ) { $this->_build_attachement(); $this->body= $this->body . $this->attachment; } $mail = $this->headers; $mail .= "\n$this->body"; return $mail; } /* ValidEmail( $email ) * return true if email adress is ok - regex from Manuel Lemos (mlemos@acm.org) * $address : email address to check */ function ValidEmail($address) { if( ereg( ".*<(.+)>", $address, $regs ) ) { $address = $regs[1]; } if(ereg( "^[^@ ]+@([a-zA-Z0-9\-]+\.)+([a-zA-Z0-9\-]{2}|net|fr|com|gov|mil|org|edu|int)\$",$address) ) return true; else return false; } /* CheckAdresses() * check validity of email addresses * if unvalid, output an error message and exit, this may be customized * $aad : array of emails addresses */ function CheckAdresses( $aad ) { for($i=0;$i< sizeof( $aad); $i++ ) { if( ! $this->ValidEmail( $aad[$i]) ) { echo "Class Mail, method Mail : Adresse Invalide $aad[$i]"; exit; } } } /********************** PRIVATE METHODS BELOW **********************************/ /* _build_headers() * [INTERNAL] build the mail headers */ function _build_headers() { // creation du header mail $this->headers= "From: $this->from\n"; $this->to= implode( ", ", $this->sendto ); if( count($this->acc) > 0 ) { $this->cc= implode( ", ", $this->acc ); $this->headers .= "CC: $this->cc\n"; } if( count($this->abcc) > 0 ) { $this->bcc= implode( ", ", $this->abcc ); $this->headers .= "BCC: $this->bcc\n"; } if( $this->organization != "" ) $this->headers .= "Organization: $this->organization\n"; if( $this->priority != "" ) $this->headers .= "X-Priority: $this->priority\n"; } /* * _build_attachement() * internal use only - check and encode attach file(s) */ function _build_attachement() { $this->boundary= "------------" . md5( uniqid("myboundary") ); // TODO : variable bound $this->headers .= "MIME-Version: 1.0\nContent-Type: multipart/mixed;\n boundary=\"$this->boundary\"\n\n"; $this->fullBody = "This is a multi-part message in MIME format.\n--$this->boundary\nContent-Type: text/plain; charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\n" . $this->body ."\n"; $sep= chr(13) . chr(10); $ata= array(); $k=0; // for each attached file, do... for( $i=0; $i < sizeof( $this->aattach); $i++ ) { $filename = $this->aattach[$i]; $basename = basename($filename); $ctype = $this->actype[$i]; // content-type $disposition = $this->adispo[$i]; if( ! file_exists( $filename) ) { echo "Class Mail, method attach : file $filename can't be found"; exit; } $subhdr= "--$this->boundary\nContent-type: $ctype;\n name=\"$basename\"\nContent-Transfer-Encoding: base64\nContent-Disposition: $disposition;\n filename=\"$basename\"\n"; $ata[$k++] = $subhdr; // non encoded line length $linesz= filesize( $filename)+1; $fp= fopen( $filename, 'r' ); $data= base64_encode(fread( $fp, $linesz)); fclose($fp); $ata[$k++] = chunk_split( $data ); } $this->attachment= implode($sep, $ata); } } // class Mail ?>
L'utilisation de cette classe se fait de la manière suivante :
function sendMailAgence ( $TO, $FROM, $filename ){ $email = $FROM; $dest = $TO; $copy_dest = ""; /* Email pour la Copie Carbone (CC) */ $cache_dest = ""; /* Email pour la Copie Carbone (BCC) */ $subject = "MON SUJET A REMPLIR"; $priority = "3"; $msg="CECI EST MON MESSAGE ENVOYE PAR MAIL"; /* Contruction du mail */ $m= new Mail; // create the mail $m->From( "$email" ); $m->To( "$dest"); $m->Subject( "$subject" ); $m->Body( $msg); // set the body /* S'il y a une copie conforme du mail */ if ($copy_dest!="") { $m->Cc( "$copy_dest"); } // --- Fix the priority $m->Priority($priority) ; /* S'il y a une copie cachée du mail */ if ($cache_dest!="") { $m->Bcc( "$cache_dest"); } // --- Fix the priority; $m->Priority($priority) ; // --- Attach file to the mail $NomFichier_name = $this->_file; $m->Attach( "$filename ", "application/octet-stream" ); $m->Send(); /* Envoi du mail */ }
Ta fonction s'utilise en passant en paramètre l'adresse mail de l'envoyeur et celle du destinataire, ainsi que le chemin d'acces au fichier que tu souhaite envoyer en pièce jointe.
Pour pouvoir utiliser la "bibliothèque" Mail.class.php, il faut l'inclure dans ton script PHP de la facon suivante :
include "./Mail.class.php";
A mettre au début du script PHP.
Voilà, je pense que tu as toutes les informations utiles pour pouvoir réaliser ton projet.
Bon courage pour la mise en place :)