par
mppn » 12 févr. 2011, 09:59
Voici :
Code Form du HTML
Attention c'est uniquement dans ce code HTML que je "traite" la capture des paramètres, ils sont ensuite affectés aux variables id_5 et id_6:
<FORM name="formulaire" ACTION="formulaire.php" METHOD="POST" ENCTYPE="multipart/form-data" id="formulaire">
<TAGEMAIL>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" width="712" style="border-style: solid; border-width: 1px" bordercolor="#111111">
<tr id="gr1">
<td align="left" valign="top" style="border-style: none; border-width: medium" colspan="2">
<img border="0" src="images/formul1.jpg"></td>
</tr>
<tr id="gr1">
<td align="left" valign="top" style="border-style: none; border-width: medium" colspan="2" bgcolor="#FFCCFF">
<p style="margin-left: 5px; margin-right: 5px"><b><br>
<font color="#333333">Nous allons vous demander d'exprimer votre opinion
concernant l'idée suivante :</font></b></p>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align: left; margin-left: 10pt; margin-right: 10pt">
<p style="margin-left: 10px; margin-right: 10px"><b>
<font face="Tahoma" size="2" color="#800080">Parfois j'u</font></b></td>
</tr>
</table>
<p> </td>
</tr>
<tr id="gr1">
<td align="left" valign="top" style="border-style: none; border-width: medium" colspan="2" height="16" bgcolor="#FFCCFF">
<p style="margin-left: 5px; margin-right: 5px"><font color="#333333"><b>
Merci de répondre à chacune de ces trois questions:<br>
</b></font></td>
</tr>
<tr id="gr1">
<td align="left" valign="top" style="border-style: none; border-width: medium" bgcolor="#FFFFFF" colspan="2">
<p style="margin: 5px 10px"> </td>
</tr>
<tr id="gr1">
<td align="left" valign="top" style="border-style: none; border-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px">
<font color="#FF0000" face="Tahoma" size="2">* </font>
<font face="Tahoma" size="2">Etes vous tout-à-fait d’accord, plutôt
d’accord, ni d’accord ni pas d’accord, ou plutôt pas d’accord avec
l’idée suivante :</font></p>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align: left; margin-left: 10pt; margin-right: 10pt">
<p style="margin-left: 30px; margin-right: 30px"><b>
<font face="Tahoma" size="2">gfhsghsgfhsgh</font></b></td>
</tr>
</table>
<p style="margin: 5px 10px"> </p></td>
<td align="left" valign="top" style="border-style: none; border-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px"><font face="Tahoma">
<select id="id_1" name="id_1" onChange="sel_show_id1(document.formulaire.id_1.options[document.formulaire.id_1.selectedIndex].text)">
<option value=""></option>
<option value="Tout à fait d'accord"><span class=mef>Tout à fait
d'accord</span></option>
<option value="Plutôt d'accord"><span class=mef>Plutôt d'accord</span>
</option>
<option value="Ni d'accord ni pas d'accord"><span class=mef>Ni d'accord
ni pas d'accord</span></option>
<option value="Plutôt pas d'accord"><span class=mef>Plutôt pas d'accord</span>
</option></select></font></td>
</tr>
<tr id="gr2">
<td align="left" valign="top" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<p style="margin: 5px 10px"> </td>
<td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<p style="margin: 5px 10px" align="left"> </td>
</tr>
<tr id="gr2">
<td align="left" valign="top" style="border-style: none; border-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px">
<font color="#FF0000" face="Tahoma" size="2">* </font>
<font face="Tahoma" size="2">Selon vous personnellement, l’affirmation
suivante, correspondant-elle à un besoin indispensable, nécessaire,
utile ou inutile<font color="#FF0000"> </font>:</font></p>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align: left; margin-left: 10pt; margin-right: 10pt">
<p style="margin-left: 30px; margin-right: 30px"><b>
<font face="Tahoma" size="2">gfhsghsgfhsgh</font></b></td>
</tr>
</table>
<p style="margin: 5px 10px"> </p></td>
<td align="left" valign="top" style="border-style: none; border-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px"><font face="Tahoma">
<select id="id_2" name="id_2" onChange="sel_show_id2(document.formulaire.id_2.options[document.formulaire.id_2.selectedIndex].text)">
<option value=""></option>
<option value="Indispensable"><span class=mef>Indispensable</span>
</option>
<option value="Nécessaire"><span class=mef>Nécessaire</span></option>
<option value="Utile"><span class=mef>Utile</span></option>
<option value="Inutile"><span class=mef>Inutile</span></option></select></font></td>
</tr>
<tr id="gr3">
<td align="left" valign="top" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<p style="margin: 5px 10px"> </td>
<td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<p style="margin: 5px 10px" align="left"> </td>
</tr>
<tr id="gr3">
<td align="left" valign="top" style="border-style: none; border-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px">
<font color="#FF0000" face="Tahoma" size="2">*</font><font face="Tahoma" size="2">
Selon vous, l'entreprise qui parviendra à résoudre la difficulté
suivante, sera-t-elle: extrêmement innovante, très innovante, assez
innovante ou peu innovante<font color="#FF0000"> </font>:</font></p>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align: left; margin-left: 10pt; margin-right: 10pt">
<p style="margin-left: 30px; margin-right: 30px"><b>
<font face="Tahoma" size="2">gfhsghsgfhsgh</font></b></td>
</tr>
</table>
<p style="margin: 5px 10px"> </p></td>
<td align="left" valign="top" style="border-style: none; border-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px"><font face="Tahoma">
<select id="id_3" name="id_3" onChange="sel_show_id3(document.formulaire.id_3.options[document.formulaire.id_3.selectedIndex].text)">
<option value=""></option>
<option value="Extrêmement innovante"><span class=mef>Extrêmement
innovante</span></option>
<option value="Très innovante"><span class=mef>Très innovante</span>
</option>
<option value="Assez innovante"><span class=mef>Assez innovante</span>
</option>
<option value="Peu innovante"><span class=mef>Peu innovante</span>
</option></select></font></td>
</tr>
<tr id="gr4">
<td align="left" valign="top" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<p style="margin: 5px 10px"> </td>
<td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<p style="margin: 5px 10px" align="left"> </td>
</tr>
<tr id="gr4">
<td align="left" valign="top" style="border-left-style: none; border-left-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px"><font face="Tahoma" size="2">Si vous pensez
que cette idée peut être améliorée :</font></p>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align: left; margin-left: 10pt; margin-right: 10pt">
<p style="margin-left: 30px; margin-right: 30px"><b>
<font face="Tahoma" size="2">gfhsghsgfhsgh</font></b></td>
</tr>
</table>
<p style="margin: 5px 10px"><font face="Tahoma" size="2">vous pouvez la
réécrire ici (facultatif) : </font></p>
<p style="margin: 5px 10px"> </p>
<p style="margin: 5px 10px"> </p></td>
<td style="border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px" align="left">
<textarea rows="6" name="id_4" cols="33"></textarea><p style="margin: 5px 10px" align="left">
</td>
</tr>
<tr>
<td colspan=2>
<input type="hidden" name="id_5" value=panel>
</tr>
<tr>
<td colspan=2 align=center>
<p align="left">
<input type="hidden" id="id_5" value="<?php $_GET['panel']; ?>">
<span class=obli><font face="Tahoma" size="2">* Ces
champs sont obligatoires.</font></span></td>
</tr>
<tr>
<td colspan=2>
<table width=100%>
<tr>
<td width=50%>
<p align="center"><font size="2" face="Tahoma">
<input type="submit" name="reset" value="Valider" class=submit></font></td>
<td width=50%>
<p align="center"><font size="2" face="Tahoma">
<input type="reset" name="reset1" value="Annuler" class=reset></font></td>
</tr>
</table></td>
</tr>
</table>
</form>
FICHIER PHP
<?PHP
session_start();
$page_courante=1;
$num_cde=rand(10000,90000);
if ($_SESSION['page_courante']>$page_courante)
{
$retour_precedent=true;
}
$_SESSION['page_courante']=$page_courante;
$url_upload='';
$data='';
function convert_date_fr($date){
$myd=explode("/",$date);
return $myd[2]."-".$myd[1]."-".$myd[0];
}
$_SESSION["champs"]["1"]["libelle"]="evaluation idée";
$_SESSION["champs"]["1"]["contenu"]=str_replace('"','\"',$_POST["id_1"]);
$_SESSION["champs"]["2"]["libelle"]="evaluation besoin";
$_SESSION["champs"]["2"]["contenu"]=str_replace('"','\"',$_POST["id_2"]);
$_SESSION["champs"]["3"]["libelle"]="evaluation difficulté";
$_SESSION["champs"]["3"]["contenu"]=str_replace('"','\"',$_POST["id_3"]);
$_SESSION["champs"]["4"]["libelle"]="Observation";$_SESSION["champs"]["4"]["contenu"]=str_replace('"','\"',$_POST["id_4"]);$_SESSION["champs"]["5"]["libelle"]="Code paneliste";$_SESSION["champs"]["5"]["contenu"]=str_replace('"','\"',$_POST["id_5"]);$_SESSION["champs"]["6"]["libelle"]="Code insight";$_SESSION["champs"]["6"]["contenu"]=str_replace('"','\"',$_POST["id_6"]);$page_web="[page_prec]";
$page_web=str_replace("[SESSION_ID]","?".session_name()."=".session_id(),$page_web);
$chiffre=rand(100,999).rand(100,999).rand(100,999);
IF (!file_exists("./upload")){
umask(0);
@mkdir("./upload",0777);
}
IF (!file_exists("./upload/$chiffre")){
umask(0);
@mkdir("./upload/$chiffre",0777);
}$nb_fic=0;
$url_chemin=str_replace("formulaire.php","","http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'] );
$data.=$url_upload;
include('class.phpmailer.php');
if (@count($_SESSION["champs"] )>0) {
foreach ($_SESSION["champs"] as $key => $value) {
$data.=$value["libelle"]."=".$value["contenu"]."<br>";
}
}
$data.=$msg_client_txt;
if (!$fp=fopen('./upload/'.$chiffre.'/renseignements.htm','w')){}else {;
fputs($fp,$data);
fclose($fp);}
$mail = new PHPMailer();
$mail->From = "";
$mail->FromName = "Vous";
$mail->Subject="" ;
$mail->AddAddress('', '');
$mail->Body = $data.$msg_html_prod;
$mail->AltBody = $data.$msg_txt_prod;
if ($nb_fic>0 && $envoi_mail_pj==1){
$x=1;
while ($x<=count($tab_fic)){
//$m->attachFile($tab_fic[$x][0],$tab_fic[$x][1]);
$mail->AddAttachment($tab_fic[$x][0], $tab_fic[$x][1]);
$x++;
}
}
$mail->send();
$CONFIG_BD_serveur ="";
$CONFIG_BD_login = "";
$CONFIG_BD_pass = "";
$CONFIG_BD_base = "";
$id= @mysql_connect($CONFIG_BD_serveur,$CONFIG_BD_login,$CONFIG_BD_pass) or die('erreur cnx');
mysql_select_db("$CONFIG_BD_base");
$query="insert into evalinsight set date_form=NOW(), id_1='".$_POST["id_1"]."'
,id_2='".$_POST["id_2"]."'
,id_3='".$_POST["id_3"]."'
,id_4='".mysql_escape_string($_POST["id_4"])."'
,id_5='".mysql_escape_string($_POST["id_5"])."'
,id_6='".mysql_escape_string($_POST["id_6"])."'
";
$res=mysql_query($query);
$num_id=mysql_insert_id();
$_SESSION['num_id']=$num_id;
session_destroy() ;
header("");
exit();
?>
Voici :
Code Form du HTML
Attention c'est uniquement dans ce code HTML que je "traite" la capture des paramètres, ils sont ensuite affectés aux variables id_5 et id_6:
<FORM name="formulaire" ACTION="formulaire.php" METHOD="POST" ENCTYPE="multipart/form-data" id="formulaire">
<TAGEMAIL>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" width="712" style="border-style: solid; border-width: 1px" bordercolor="#111111">
<tr id="gr1">
<td align="left" valign="top" style="border-style: none; border-width: medium" colspan="2">
<img border="0" src="images/formul1.jpg"></td>
</tr>
<tr id="gr1">
<td align="left" valign="top" style="border-style: none; border-width: medium" colspan="2" bgcolor="#FFCCFF">
<p style="margin-left: 5px; margin-right: 5px"><b><br>
<font color="#333333">Nous allons vous demander d'exprimer votre opinion
concernant l'idée suivante :</font></b></p>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align: left; margin-left: 10pt; margin-right: 10pt">
<p style="margin-left: 10px; margin-right: 10px"><b>
<font face="Tahoma" size="2" color="#800080">Parfois j'u</font></b></td>
</tr>
</table>
<p> </td>
</tr>
<tr id="gr1">
<td align="left" valign="top" style="border-style: none; border-width: medium" colspan="2" height="16" bgcolor="#FFCCFF">
<p style="margin-left: 5px; margin-right: 5px"><font color="#333333"><b>
Merci de répondre à chacune de ces trois questions:<br>
</b></font></td>
</tr>
<tr id="gr1">
<td align="left" valign="top" style="border-style: none; border-width: medium" bgcolor="#FFFFFF" colspan="2">
<p style="margin: 5px 10px"> </td>
</tr>
<tr id="gr1">
<td align="left" valign="top" style="border-style: none; border-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px">
<font color="#FF0000" face="Tahoma" size="2">* </font>
<font face="Tahoma" size="2">Etes vous tout-à-fait d’accord, plutôt
d’accord, ni d’accord ni pas d’accord, ou plutôt pas d’accord avec
l’idée suivante :</font></p>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align: left; margin-left: 10pt; margin-right: 10pt">
<p style="margin-left: 30px; margin-right: 30px"><b>
<font face="Tahoma" size="2">gfhsghsgfhsgh</font></b></td>
</tr>
</table>
<p style="margin: 5px 10px"> </p></td>
<td align="left" valign="top" style="border-style: none; border-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px"><font face="Tahoma">
<select id="id_1" name="id_1" onChange="sel_show_id1(document.formulaire.id_1.options[document.formulaire.id_1.selectedIndex].text)">
<option value=""></option>
<option value="Tout à fait d'accord"><span class=mef>Tout à fait
d'accord</span></option>
<option value="Plutôt d'accord"><span class=mef>Plutôt d'accord</span>
</option>
<option value="Ni d'accord ni pas d'accord"><span class=mef>Ni d'accord
ni pas d'accord</span></option>
<option value="Plutôt pas d'accord"><span class=mef>Plutôt pas d'accord</span>
</option></select></font></td>
</tr>
<tr id="gr2">
<td align="left" valign="top" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<p style="margin: 5px 10px"> </td>
<td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<p style="margin: 5px 10px" align="left"> </td>
</tr>
<tr id="gr2">
<td align="left" valign="top" style="border-style: none; border-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px">
<font color="#FF0000" face="Tahoma" size="2">* </font>
<font face="Tahoma" size="2">Selon vous personnellement, l’affirmation
suivante, correspondant-elle à un besoin indispensable, nécessaire,
utile ou inutile<font color="#FF0000"> </font>:</font></p>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align: left; margin-left: 10pt; margin-right: 10pt">
<p style="margin-left: 30px; margin-right: 30px"><b>
<font face="Tahoma" size="2">gfhsghsgfhsgh</font></b></td>
</tr>
</table>
<p style="margin: 5px 10px"> </p></td>
<td align="left" valign="top" style="border-style: none; border-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px"><font face="Tahoma">
<select id="id_2" name="id_2" onChange="sel_show_id2(document.formulaire.id_2.options[document.formulaire.id_2.selectedIndex].text)">
<option value=""></option>
<option value="Indispensable"><span class=mef>Indispensable</span>
</option>
<option value="Nécessaire"><span class=mef>Nécessaire</span></option>
<option value="Utile"><span class=mef>Utile</span></option>
<option value="Inutile"><span class=mef>Inutile</span></option></select></font></td>
</tr>
<tr id="gr3">
<td align="left" valign="top" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<p style="margin: 5px 10px"> </td>
<td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<p style="margin: 5px 10px" align="left"> </td>
</tr>
<tr id="gr3">
<td align="left" valign="top" style="border-style: none; border-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px">
<font color="#FF0000" face="Tahoma" size="2">*</font><font face="Tahoma" size="2">
Selon vous, l'entreprise qui parviendra à résoudre la difficulté
suivante, sera-t-elle: extrêmement innovante, très innovante, assez
innovante ou peu innovante<font color="#FF0000"> </font>:</font></p>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align: left; margin-left: 10pt; margin-right: 10pt">
<p style="margin-left: 30px; margin-right: 30px"><b>
<font face="Tahoma" size="2">gfhsghsgfhsgh</font></b></td>
</tr>
</table>
<p style="margin: 5px 10px"> </p></td>
<td align="left" valign="top" style="border-style: none; border-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px"><font face="Tahoma">
<select id="id_3" name="id_3" onChange="sel_show_id3(document.formulaire.id_3.options[document.formulaire.id_3.selectedIndex].text)">
<option value=""></option>
<option value="Extrêmement innovante"><span class=mef>Extrêmement
innovante</span></option>
<option value="Très innovante"><span class=mef>Très innovante</span>
</option>
<option value="Assez innovante"><span class=mef>Assez innovante</span>
</option>
<option value="Peu innovante"><span class=mef>Peu innovante</span>
</option></select></font></td>
</tr>
<tr id="gr4">
<td align="left" valign="top" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<p style="margin: 5px 10px"> </td>
<td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<p style="margin: 5px 10px" align="left"> </td>
</tr>
<tr id="gr4">
<td align="left" valign="top" style="border-left-style: none; border-left-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px"><font face="Tahoma" size="2">Si vous pensez
que cette idée peut être améliorée :</font></p>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align: left; margin-left: 10pt; margin-right: 10pt">
<p style="margin-left: 30px; margin-right: 30px"><b>
<font face="Tahoma" size="2">gfhsghsgfhsgh</font></b></td>
</tr>
</table>
<p style="margin: 5px 10px"><font face="Tahoma" size="2">vous pouvez la
réécrire ici (facultatif) : </font></p>
<p style="margin: 5px 10px"> </p>
<p style="margin: 5px 10px"> </p></td>
<td style="border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" bgcolor="#CCCCCC">
<p style="margin: 5px 10px" align="left">
<textarea rows="6" name="id_4" cols="33"></textarea><p style="margin: 5px 10px" align="left">
</td>
</tr>
<tr>
<td colspan=2>
<input type="hidden" name="id_5" value=panel>
</tr>
<tr>
<td colspan=2 align=center>
<p align="left">
<input type="hidden" id="id_5" value="<?php $_GET['panel']; ?>">
<span class=obli><font face="Tahoma" size="2">* Ces
champs sont obligatoires.</font></span></td>
</tr>
<tr>
<td colspan=2>
<table width=100%>
<tr>
<td width=50%>
<p align="center"><font size="2" face="Tahoma">
<input type="submit" name="reset" value="Valider" class=submit></font></td>
<td width=50%>
<p align="center"><font size="2" face="Tahoma">
<input type="reset" name="reset1" value="Annuler" class=reset></font></td>
</tr>
</table></td>
</tr>
</table>
</form>
FICHIER PHP
<?PHP
session_start();
$page_courante=1;
$num_cde=rand(10000,90000);
if ($_SESSION['page_courante']>$page_courante)
{
$retour_precedent=true;
}
$_SESSION['page_courante']=$page_courante;
$url_upload='';
$data='';
function convert_date_fr($date){
$myd=explode("/",$date);
return $myd[2]."-".$myd[1]."-".$myd[0];
}
$_SESSION["champs"]["1"]["libelle"]="evaluation idée";
$_SESSION["champs"]["1"]["contenu"]=str_replace('"','\"',$_POST["id_1"]);
$_SESSION["champs"]["2"]["libelle"]="evaluation besoin";
$_SESSION["champs"]["2"]["contenu"]=str_replace('"','\"',$_POST["id_2"]);
$_SESSION["champs"]["3"]["libelle"]="evaluation difficulté";
$_SESSION["champs"]["3"]["contenu"]=str_replace('"','\"',$_POST["id_3"]);
$_SESSION["champs"]["4"]["libelle"]="Observation";$_SESSION["champs"]["4"]["contenu"]=str_replace('"','\"',$_POST["id_4"]);$_SESSION["champs"]["5"]["libelle"]="Code paneliste";$_SESSION["champs"]["5"]["contenu"]=str_replace('"','\"',$_POST["id_5"]);$_SESSION["champs"]["6"]["libelle"]="Code insight";$_SESSION["champs"]["6"]["contenu"]=str_replace('"','\"',$_POST["id_6"]);$page_web="[page_prec]";
$page_web=str_replace("[SESSION_ID]","?".session_name()."=".session_id(),$page_web);
$chiffre=rand(100,999).rand(100,999).rand(100,999);
IF (!file_exists("./upload")){
umask(0);
@mkdir("./upload",0777);
}
IF (!file_exists("./upload/$chiffre")){
umask(0);
@mkdir("./upload/$chiffre",0777);
}$nb_fic=0;
$url_chemin=str_replace("formulaire.php","","http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'] );
$data.=$url_upload;
include('class.phpmailer.php');
if (@count($_SESSION["champs"] )>0) {
foreach ($_SESSION["champs"] as $key => $value) {
$data.=$value["libelle"]."=".$value["contenu"]."<br>";
}
}
$data.=$msg_client_txt;
if (!$fp=fopen('./upload/'.$chiffre.'/renseignements.htm','w')){}else {;
fputs($fp,$data);
fclose($fp);}
$mail = new PHPMailer();
$mail->From = "";
$mail->FromName = "Vous";
$mail->Subject="" ;
$mail->AddAddress('', '');
$mail->Body = $data.$msg_html_prod;
$mail->AltBody = $data.$msg_txt_prod;
if ($nb_fic>0 && $envoi_mail_pj==1){
$x=1;
while ($x<=count($tab_fic)){
//$m->attachFile($tab_fic[$x][0],$tab_fic[$x][1]);
$mail->AddAttachment($tab_fic[$x][0], $tab_fic[$x][1]);
$x++;
}
}
$mail->send();
$CONFIG_BD_serveur ="";
$CONFIG_BD_login = "";
$CONFIG_BD_pass = "";
$CONFIG_BD_base = "";
$id= @mysql_connect($CONFIG_BD_serveur,$CONFIG_BD_login,$CONFIG_BD_pass) or die('erreur cnx');
mysql_select_db("$CONFIG_BD_base");
$query="insert into evalinsight set date_form=NOW(), id_1='".$_POST["id_1"]."'
,id_2='".$_POST["id_2"]."'
,id_3='".$_POST["id_3"]."'
,id_4='".mysql_escape_string($_POST["id_4"])."'
,id_5='".mysql_escape_string($_POST["id_5"])."'
,id_6='".mysql_escape_string($_POST["id_6"])."'
";
$res=mysql_query($query);
$num_id=mysql_insert_id();
$_SESSION['num_id']=$num_id;
session_destroy() ;
header("");
exit();
?>