Hello à tous,
J'ai fait un formulaire avec récupération des données et envoie par mail des données et page avec affichage des données récupérées et possibiliter d'imprimer la page.
voici ce que çà donne
J'aurais aimé savoir ce que vous en pensez etr ce que je pourrai améliorer.
Je vous les codes.
Le formulaire :
La page de récupération :
Je vous remerci de me préter un peu d'attention. A+
Modifié par Heyoan (15 Feb 2010 - 11:10)
J'ai fait un formulaire avec récupération des données et envoie par mail des données et page avec affichage des données récupérées et possibiliter d'imprimer la page.
voici ce que çà donne
J'aurais aimé savoir ce que vous en pensez etr ce que je pourrai améliorer.
Je vous les codes.
Le formulaire :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>Devis pour machine pesonnalisée de fabrication de panneaux en bois</title>
<script language="javascript" type="text/javascript">
function calculeLongueur(){
var iLongueur, iLongueurRestante;
iLongueur = document.getElementById('message').value.length;
if (iLongueur>400) {
document.getElementById('message').value = document.getElementById('message').value.substring(0,400);
iLongueurRestante = 0;
}
else {
iLongueurRestante = 400 - iLongueur;
}
if (iLongueurRestante <= 1)
document.getElementById('indic').innerHTML = iLongueurRestante + " caractère disponible";
else
document.getElementById('indic').innerHTML = iLongueurRestante + " caractères disponibles";
}
function imprimer(){window.location();}
</script>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="screen" type="text/css" title="design" href="page01.css" />
</head>
<body>
<form action = "recapitulatif.php" method="post" enctype="application/x-www-form-urlencoded" name="formulaire" onSubmit="retur">
<div id="image">
<div class="contact">
Société : <br /> <input type = "text" name = "societe" size="45" maxlength="35" id="societe"><br />
Nom : Prénom :
<br /> <select name="civilite">
<option value="M.">M.</option>
<option value="Mme.">Mme.</option>
<option value="Mlle.">Mlle.</option>
</select>
<input type = "text" name = "nom" size="14" maxlength="18"> <input type = "text" name = "prenom" size="14" maxlength="18"><br />
E-mail : <br /> <input type = "text" name = "mail" size="45" maxlength="35">
<br />
<br />
<input type = "submit" name="envoie" value = "Envoyer le formulaire rempli">
<br /><br />
<input name="imprimer" type="button" value="Imprimer un formulaire vierge" onclick="window.open('http://www.societe.com/devis/caisse_en_bois/imprime.pdf')">
</div>
<div class="commentaires">
<textarea name="message" rows="13" cols="35" onblur="calculeLongueur();" onfocus="calculeLongueur();" onkeydown="calculeLongueur();" onkeyup="calculeLongueur();"/></textarea>
<div id="indic">400 caractères disponibles</div>
</div>
<div class="a">
<input type = "text" name = "a" size="1" maxlength="4" value="min">
</div>
<div class="b">
<input type = "text" name = "b" size="1" maxlength="4" value="max">
</div>
<div class="m">
<input type = "text" name = "m" size="1" maxlength="4" value="min">
</div>
<div class="n">
<input type = "text" name = "n" size="1" maxlength="4" value="max">
</div>
<div class="c">
<input type = "text" name = "c" size="1" maxlength="4" value="min">
</div>
<div class="d">
<input type = "text" name = "d" size="1" maxlength="4" value="max">
</div>
<div class="o">
<input type = "text" name = "o" size="1" maxlength="4" value="min">
</div>
<div class="p">
<input type = "text" name = "p" size="1" maxlength="4" value="max">
</div>
<div class="g">
<input type = "text" name = "g" size="1" maxlength="4" value="min">
</div>
<div class="h">
<input type = "text" name = "h" size="1" maxlength="4" value="max">
</div>
<div class="i">
<input type = "text" name = "i" size="1" maxlength="4" value="min">
</div>
<div class="j">
<input type = "text" name = "j" size="1" maxlength="4" value="max">
</div>
<div class="k">
<input type = "text" name = "k" size="1" maxlength="4" value="min">
</div>
<div class="l">
<input type = "text" name = "l" size="1" maxlength="4" value="max">
</div>
<div class="e">
<input type = "text" name = "e" size="1" maxlength="4" value="min">
</div>
<div class="f">
<input type = "text" name = "f" size="1" maxlength="4" value="max">
</div>
<div class="q">
<input type = "text" name = "q" size="1" maxlength="4" value="min">
</div>
<div class="r">
<input type = "text" name = "r" size="1" maxlength="4" value="max">
</div>
<div class="s">
<input type = "text" name = "s" size="1" maxlength="4" value="min">
</div>
<div class="t">
<input type = "text" name = "t" size="1" maxlength="4" value="max">
</div>
<div class="site">
<a href="http://www.societe.com" title="Site Internet de societe sarl" target="_blank">www.societe.com</a>
</div>
<div class="mail">
<a href="http://www.societe.com/contactez-nous.html" title="contactez-nous" target="_blank">nous contacter</a>
</div>
</div>
</form>
</body>
</html>
La page de récupération :
<?php
/* Récupération des valeurs des champs du formulaire */
if (get_magic_quotes_gpc())
{
$nom = stripslashes($_POST['nom']);
$civilite= stripslashes($_POST['civilite']);
$societe = stripslashes($_POST['societe']);
$mail = stripslashes($_POST['mail']);
$prenom = stripslashes($_POST['prenom']);
$message = stripslashes($_POST['message']);
$panneaux_pleins = stripslashes($_POST['panneaux pleins']);
$panneaux_a_claire_voie = stripslashes($_POST['panneaux a claire voie']);
$a = stripslashes($_POST['a']);
$b = stripslashes($_POST['b']);
$c = stripslashes($_POST['c']);
$d = stripslashes($_POST['d']);
$e = stripslashes($_POST['e']);
$f = stripslashes($_POST['f']);
$g = stripslashes($_POST['g']);
$h = stripslashes($_POST['h']);
$i = stripslashes($_POST['i']);
$j = stripslashes($_POST['j']);
$k = stripslashes($_POST['k']);
$l = stripslashes($_POST['l']);
$m = stripslashes($_POST['m']);
$n = stripslashes($_POST['n']);
$o = stripslashes($_POST['o']);
$p = stripslashes($_POST['p']);
$q = stripslashes($_POST['q']);
$r = stripslashes($_POST['r']);
$s = stripslashes($_POST['s']);
$t = stripslashes($_POST['t']);
}
else
{
$nom = $_POST['nom'];
$civilite = $_POST['civilite'];
$societe = $_POST['societe'];
$mail = $_POST['mail'];
$prenom = $_POST['prenom'];
$message = $_POST['message'];
$panneaux_pleins =$_POST['panneaux pleins'];
$panneaux_a_claire_voie =$_POST['panneaux_a_claire_voie'];
$a = $_POST['a'];
$b = $_POST['b'];
$c = $_POST['c'];
$d = $_POST['d'];
$e = $_POST['e'];
$f = $_POST['f'];
$g = $_POST['g'];
$h = $_POST['h'];
$i = $_POST['i'];
$j = $_POST['j'];
$k = $_POST['k'];
$l = $_POST['l'];
$m = $_POST['m'];
$n = $_POST['n'];
$o = $_POST['o'];
$p = $_POST['p'];
$q = $_POST['q'];
$r = $_POST['r'];
$s = $_POST['s'];
$t = $_POST['t'];
}
/* Destinataire (mon adresse e-mail) */
$to = 'machintruc@machintruc.fr';
/* Construction du message */
$msg = 'Bonjour,'."\r\n\r\n";
$msg .= 'Ce mail a été envoyé depuis la page Devis pour la Machine à Bois par '.$civilite.' '.$nom.' '.$prenom.' de la société '.$societe."\r\n";
$msg .= 'Son adresse e-mail est :'.$mail."\r\n\r\n";
$msg .= 'Voici le message qui vous est adressé :'."\r\n";
$msg .= '***************************'."\r\n";
$msg .= $message."\r\n";
$msg .= '***************************'."\r\n";
$msg .= 'Et les caractéristiques souhaité pour leur machine à bois personnalisé :'."\r\n";
$msg .= 'a='.$a."\r\n";
$msg .= 'b='.$b."\r\n";
$msg .= 'c='.$c."\r\n";
$msg .= 'd='.$d."\r\n";
$msg .= 'e='.$e."\r\n";
$msg .= 'f='.$f."\r\n";
$msg .= 'g='.$g."\r\n";
$msg .= 'h='.$h."\r\n";
$msg .= 'i='.$i."\r\n";
$msg .= 'j='.$j."\r\n";
$msg .= 'k='.$k."\r\n";
$msg .= 'l='.$l."\r\n";
$msg .= 'm='.$m."\r\n";
$msg .= 'n='.$n."\r\n";
$msg .= 'o='.$o."\r\n";
$msg .= 'p='.$p."\r\n";
$msg .= 'q='.$q."\r\n";
$msg .= 'r='.$r."\r\n";
$msg .= 's='.$s."\r\n";
$msg .= 't='.$t."\r\n";
/* En-têtes de l'e-mail */
$headers = 'From: '.$nom.' '.$prenom.' <'.$mail.'>\n';
/* Envoi de l'e-mail */
mail($to, $mail, $msg);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>Devis machine bois</title>
<script language="Javascript">
function imprimer(){window.print();}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="print" type="text/css" title="Design" href="design_page02.css" />
<style type="text/css">
@page { size: portrait; } ;
margin-top:0.5cm;
margin-bottom:0.5cm;
margin-left:0.5cm;
margin-right:0.5cm;
</style>
</head>
<body>
<p>
<center><img src="logo.png" alt="logo"/></center>
</p>
<p>Bonjour <?php echo $_POST['civilite']; ?> <?php echo $_POST['nom']; ?>,</p>
<p>
<br />
La société Société sarl vous remercie de votre consultation.<br />
Nous traiterons le devis de votre machine dans les plus bref délais et nous l'enverrons
à <?php echo $_POST['mail']; ?>.<br /> <br />
Dans l'attente d'un prochain contact, voici le récapitulatif des capacités souhaitées pour votre machine
de préparation de panneaux de caisses et containers de planches en bois. <br /> <br />
Cordiales salutations, <br /><br />
</p>
<p>
<center><img src="image02.png" alt="cotation caisse en bois" id="image" /></center>
</p>
<center><table border="1">
<tbody>
<tr>
<td colspan="4">Panneaux</td>
<td colspan="12">Chevrons</td>
<td colspan="6">Planches</td>
</tr>
<tr>
<td colspan="2">Longueur</td>
<td colspan="2">Largeur</td>
<td colspan="2">Longueur</td>
<td colspan="2">Largeur</td>
<td colspan="2">Epaisseur</td>
<td colspan="2">Nombre</td>
<td colspan="2">Largeur</td>
<td colspan="2">Epaisseur</td>
<td colspan="2">Longueur</td>
<td colspan="2">Largeur</td>
<td colspan="2">Epaisseur</td>
</tr>
<tr>
<td>mini</td>
<td>maxi</td>
<td>mini</td>
<td>maxi</td>
<td>mini</td>
<td>maxi</td>
<td>mini</td>
<td>maxi</td>
<td>mini</td>
<td>maxi</td>
<td>mini</td>
<td>maxi</td>
<td>mini</td>
<td>maxi</td>
<td>mini</td>
<td>maxi</td>
<td>mini</td>
<td>maxi</td>
<td>mini</td>
<td>maxi</td>
<td>mini</td>
<td>maxi</td>
</tr>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td>e</td>
<td>f</td>
<td>g</td>
<td>h</td>
<td>i</td>
<td>j</td>
<td>k</td>
<td>l</td>
<td>q</td>
<td>r</td>
<td>s</td>
<td>t</td>
<td>c</td>
<td>d</td>
<td>m</td>
<td>n</td>
<td>o</td>
<td>p</td>
</tr>
<tr>
<td><?php echo $_POST['a']; ?> </td>
<td><?php echo $_POST['b']; ?> </td>
<td><?php echo $_POST['c']; ?> </td>
<td><?php echo $_POST['d']; ?> </td>
<td><?php echo $_POST['e']; ?> </td>
<td><?php echo $_POST['f']; ?> </td>
<td><?php echo $_POST['g']; ?> </td>
<td><?php echo $_POST['h']; ?> </td>
<td><?php echo $_POST['i']; ?> </td>
<td><?php echo $_POST['j']; ?> </td>
<td><?php echo $_POST['k']; ?> </td>
<td><?php echo $_POST['l']; ?> </td>
<td><?php echo $_POST['q']; ?> </td>
<td><?php echo $_POST['r']; ?> </td>
<td><?php echo $_POST['s']; ?> </td>
<td><?php echo $_POST['t']; ?> </td>
<td><?php echo $_POST['c']; ?> </td>
<td><?php echo $_POST['d']; ?> </td>
<td><?php echo $_POST['m']; ?> </td>
<td><?php echo $_POST['n']; ?> </td>
<td><?php echo $_POST['o']; ?> </td>
<td><?php echo $_POST['p']; ?> </td>
</tr>
</tbody>
</table>
<h4>Vos commentaires :</h4>
<table border="0" width="400">
<tbody>
<tr>
<td><?php echo $_POST['message']; ?></td>
</tr>
</tbody>
</table>
</center>
<p>
<input name="imprimer" onclick="imprimer()" type="button" value="Imprimer cette page">
</p>
<p class="footer"><span style="color: #0000ff; font-family: arial,helvetica,sans-serif; font-size:70%;">
<center><br />CONTACTS : ...
</center></span>
</p>
</body>
</html>
Je vous remerci de me préter un peu d'attention. A+
Modifié par Heyoan (15 Feb 2010 - 11:10)