créer un site


aide pour du codage

Poster un nouveau sujet sur Création site web   Répondre au sujet à Création site web:aide pour du codage    Accueil Forum -> Création site web
Voir le sujet précédent :: Voir le sujet suivant  
Auteur Message
totoutarts
frontpage mioche
frontpage mioche
Messageaide pour du codage , Posté le: 25-01-2010 17:16

Bonjour,

Je viens de créer un formulaire sur mon site à partir de phpform. cela fonction vous pouvez le voir à cette adresse http://www.totoutarts.fr/guppy/pages/formulaire.php.

J'ai mon formulaire que les gens renseigne. Une fois le formulaire rempli un accusé de réception apparait (ça c'est bon) et le formulaire est envoyé à deux destinataires.

J'ai deux problèmes le premier est que le formulaire envoyé s'affiche en code html chez le destinataire et je souhaiterai qu'il s'affiche sous forme de tableau;
2eme problème c'est que mon code html ne supporte pas l'apostrophe.
Pouvez vous m'aider ?
Ci dessous le code du fichier process.php que j'utilise (c'est peut être pas trés correct comme code...


<html>
<head>
<meta content="text/html>
<title></title>
</head>

<body>
<?php
include("global.inc.php");
$errors=0;
$error="Les erreurs suivantes se sont produites en traitant votre entrée de forme.<ul>";
pt_register('POST','nom');
pt_register('POST','prenom');
pt_register('POST','ville');
pt_register('POST','mail');
pt_register('POST','nom1');
pt_register('POST','prenom1');
pt_register('POST','ville1');
pt_register('POST','mail1');
pt_register('POST','nature');
pt_register('POST','date');
pt_register('POST','lieu');
pt_register('POST','montant');
pt_register('POST','ponctuel');
pt_register('POST','regulier');
pt_register('POST','individuel');
pt_register('POST','collectif');
pt_register('POST','texte');
$texte=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $texte);$fiche=$HTTP_POST_FILES['fiche'];
if($nom=="" || $prenom=="" || $ville=="" || $mail=="" || $nom1=="" || $prenom1=="" || $ville1=="" || $mail1=="" || $nature=="" || $date=="" || $lieu=="" || $montant=="" ){
$errors=1;
$error.="<li>Vous n'avez pas écrit un ou plusieurs des champs priés. Veuillez retourner et essayer encore.";
}
if($HTTP_POST_FILES['fiche']['tmp_name']==""){ }
else if(!is_uploaded_file($HTTP_POST_FILES['fiche']['tmp_name'])){
$error.="<li>The file, ".$HTTP_POST_FILES['fiche']['name'].", was not uploaded!";
$errors=1;
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$mail)){
$error.="<li>mail entré invalide";
$errors=1;
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$mail1)){
$error.="<li>mail entré invalide";
$errors=1;
}
if($errors==1) echo $error;
else{
$image_part = date("h_i_s")."_".$HTTP_POST_FILES['fiche']['name'];
$image_list[17] = $image_part;
copy($HTTP_POST_FILES['fiche']['tmp_name'], "files/".$image_part);
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="nom: ".$nom."
prenom: ".$prenom."
ville: ".$ville."
mail: ".$mail."
nom1: ".$nom1."
prenom1: ".$prenom1."
ville1: ".$ville1."
mail1: ".$mail1."
nature: ".$nature."
date: ".$date."
lieu: ".$lieu."
montant: ".$montant."
ponctuel: ".$ponctuel."
regulier: ".$regulier."
individuel: ".$individuel."
collectif: ".$collectif."
texte: ".$texte."
fiche: ".$where_form_is."files/".$image_list[17]."
";
$message = stripslashes($message);
$txtemail = '
<HTML><HEAD><content="text/html;></HEAD>
<body>
<div align="center">
<table border="0" width="60%">
<tr>
<td valign="top">
<img border="0" src="file:///C:/Documents%20and%20Settings/remy/Bureau/LogoTTT.gif" width="90" height="81"></td>
<td><b><font face="Verdana" size="2" color="#7A7999">Bonjour
'.$_POST['nom1'].' ce bon vous est envoyé par </font>
</b>
<font face="Verdana" color="#7A7999" size="2"> </font><b><font color="#7A7999" face="Verdana" size="2">'.$_POST['nom'].'
pour finaliser votre échange.</font></b><p><b>
<font face="Verdana" size="2" color="#7A7999">Il a été envoyé également à
Totoutarts.</font></b></p>
<p><b><font face="Verdana" size="2" color="#7A7999">Nous vous invitons à
reprendre contact avec le service une fois cet échange réalisé afin de mettre à
jour votre compte.</font></b></p>
<p><b><font face="Verdana" size="2" color="#7A7999">Bon échange....</font></b></p>
</td>
</tr>
</table>
</div>




<table border="1" width="60%" id="table1" bgcolor="#EFF3F7">
<tr>
<td bgcolor="#6B9DDE" height="35">
<p align="left"><b><font face="Verdana" color="#FFFFFF">ECHANGES</font></b></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" height="8">
<font color="#FFFFFF" size="1">f</font></td>
</tr>
<tr>
<td bgcolor="#B5CBEF" height="35">
<b><font face="Verdana" color="#FFFFFF">Entre :</font></b></td>
</tr>
<tr>
<td bgcolor="#EFF3F7">
<font face="Verdana" color="#7A7999" size="2">Nom :
</font><b>
<font color="#7A7999" face="Verdana" size="2">
'.$_POST['nom'].' </font></b>
<font color="#7A7999" face="Verdana" size="2">
Prénom : <b>'.$_POST['prenom'].'</b></font><b><font color="#7A7999" face="Verdana" size="2"> </font>
</b> </td>
</tr>
<tr>
<td align="left" bgcolor="#EFF3F7">
<font color="#7A7999">Ville : </font> <b>
<font color="#7A7999" face="Verdana" size="2">
'.$_POST['ville'].' </font></b> </td>
</tr>
<tr>
<td align="left" bgcolor="#EFF3F7">
<font color="#7A7999" face="Verdana" size="2">
Mail : </font><b>
<font color="#7A7999" face="Verdana" size="2">
'.$_POST['mail'].' </font></b> </td>
</tr>
<tr>
<td bgcolor="#B5CBEF">
<b><font face="Verdana" color="#FFFFFF">Et : </font></b> </td>
</tr>
<tr>
<td bgcolor="#EFF3F7">
<font face="Verdana" color="#7A7999" size="2">Nom :
</font><b>
<font color="#7A7999" face="Verdana" size="2">
'.$_POST['nom1'].' </font></b>
<font color="#7A7999" face="Verdana" size="2">
Prénom : <b>'.$_POST['prenom1'].'</b></font><b><font color="#7A7999" face="Verdana" size="2"> </font>
</b> </td>
</tr>
<tr>
<td align="left" bgcolor="#EFF3F7">
<font color="#7A7999">Ville : </font> <b>
<font color="#7A7999" face="Verdana" size="2">
'.$_POST['ville1'].' </font></b> </td>
</tr>
<tr>
<td align="left" bgcolor="#EFF3F7">
<font color="#7A7999" face="Verdana" size="2">
Mail : </font><b>
<font color="#7A7999" face="Verdana" size="2">
'.$_POST['mail1'].' </font></b> </td>
</tr>
<tr>
<td bgcolor="#B5CBEF">
<b><font face="Verdana" color="#FFFFFF">Nature des echanges </font></b> </td>
</tr>
<tr>
<td bgcolor="#EFF3F7">
<font face="Verdana" size="2" color="#7A7999">Intitulé : </font><b>
<font color="#7A7999" face="Verdana" size="2">
'.$_POST['nature'].' </font></b> </td>
</tr>
<tr>
<td align="left" bgcolor="#EFF3F7">
<font color="#7A7999">date : </font> <b>
<font color="#7A7999" face="Verdana" size="2">
'.$_POST['date'].' </font></b> </td>
</tr>
<tr>
<td align="left" bgcolor="#EFF3F7">
<font face="Verdana" size="2" color="#7A7999">lieu : </font><b>
<font color="#7A7999" face="Verdana" size="2">
'.$_POST['lieu'].' </font></b> </td>
</tr>
<tr>
<td align="left" bgcolor="#EFF3F7" height="24">
<font color="#7A7999">montant en peson : </font> <b>
<font color="#7A7999" face="Verdana" size="2">
'.$_POST['montant'].' </font></b> </td>
</tr>


<tr>
<td align="left" bgcolor="#EFF3F7">
<font color="#7A7999">ponctuel : </font> <b>
<font color="#7A7999" face="Verdana" size="2">
'.$_POST['ponctuel'].'</font></b></td>
</tr>


<tr>
<td align="left" bgcolor="#EFF3F7">
<font color="#7A7999">régulier : </font> <b>
<font color="#7A7999" face="Verdana" size="2">
'.$_POST['regulier'].'</font></b></td>
</tr>


<tr>
<td align="left" bgcolor="#EFF3F7">
<font color="#7A7999">individuel : </font> <b>
<font color="#7A7999" face="Verdana" size="2">
'.$_POST['individuel'].'</font></b></td>
</tr>


<tr>
<td align="left" bgcolor="#EFF3F7">
<font color="#7A7999">collectif : </font> <b>
<font color="#7A7999" face="Verdana" size="2">
'.$_POST['collectif'].'</font></b></td>
</tr>


<tr>
<td align="left" bgcolor="#EFF3F7" height="26">
<font color="#7A7999">Message : </font> <b>
<font color="#7A7999" face="Verdana" size="2">
'.$_POST['texte'].'</font></b></td>
</tr>


<tr>
<td align="left" bgcolor="#EFF3F7" height="26">
<font color="#7A7999">Pièce jointe : </font> <b>
<font color="#800000" face="Verdana" size="2">
<a href="'.$where_form_is."files/".$image_list[17].'"> Voir le fichier</a></font><font face="Verdana" size="2">

</tr>


</table>

</div>
</body>
</html>';
mail("contact@totoutarts.fr","Echange du Sel Tôtout'arts",$txtemail,"From:$mail");
mail("$mail1","Echange du SEL totout'arts",$txtemail,"From:$mail");
$make=fopen("admin/data.dat","a");
$to_put="";
$to_put .= $nom."|".$prenom."|".$ville."|".$mail."|".$nom1."|".$prenom1."|".$ville1."|".$mail1."|".$nature."|".$date."|".$lieu."|".$montant."|".$ponctuel."|".$regulier."|".$individuel."|".$collectif."|".$texte."|".$where_form_is."files/".$image_list[17]."
";
fwrite($make,$to_put);
?>


<!-- C'est la teneur de la page de remerciement , faites attention en le changeant-->

<body bgcolor="#F6F2E9">
<h3 align="center"><font face="Century Gothic" size="3" color="#7D779C">Merci <?php echo $prenom; ?> d'avoir enregistré
votre échange avec <?php echo $prenom1; ?><br/>
Voici le récapitulatif de cet échange qui a été envoyé à <?php echo $prenom1; ?> ainsi qu'à l'association Tôtout'arts</font></h3>
<p> </p>

<div align="center">
<table width="450" border="1" bgcolor="#EFF3F7">
<tr><td colspan="2" align="center" bgcolor="#6B9DDE" height="45">
<p align="left"><b><font face="Verdana" color="#FFFFFF">BON D'ECHANGE</font></b></td></tr>
<tr><td align="center" colspan="2" bgcolor="#B5CBEF">
<p align="left"><b><font face="Verdana" color="#FFFFFF">Entre :</font></b></td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">nom: </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $nom; ?> </font> </td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">prenom: </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $prenom; ?> </font> </td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">ville: </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $ville; ?> </font> </td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">mail: </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $mail; ?> </font> </td></tr>
<tr><td colspan="2" align="center" bgcolor="#B5CBEF">
<p align="left"><font face="Verdana" color="#FFFFFF"><b>Et :</b></font></td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">nom : </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $nom1; ?> </font> </td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">prenom : </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $prenom1; ?> </font> </td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">ville : </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $ville1; ?> </font> </td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">mail : </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $mail1; ?> </font> </td></tr>
<tr><td width="96%" colspan="2" bgcolor="#B5CBEF"><b>
<font face="Verdana" color="#FFFFFF">Nature de l'échange</font></b></td>
</tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">Intitulé : </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $nature; ?> </font> </td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">date de l'échange: </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $date; ?> </font> </td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">lieu de l'échange: </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $lieu; ?> </font> </td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">ponctuel: </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $ponctuel; ?>
</font> </td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">régulier: </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $regulier; ?>
</font> </td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">individuel: </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $individuel; ?>
</font> </td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">collectif: </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $collectif; ?>
</font> </td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">montantde l'échange </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $montant; ?> </font> </td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">message : </font>
<p> </p>
<p> </p>
<p> </td><td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $texte; ?>
</font> </td></tr>
<tr><td width="52%"><font face="Verdana" color="#7D779C">fichier : </font> </td>
<td width="44%"> <font face="Verdana" color="#7D779C"> <?php echo $fiche; ?> </font> </td></tr>

</table>
</div>
<div><p align="center"> </p>
<p align="center"><font face="Verdana" color="#7A7999">
<a href="http://www.totoutarts.fr/guppy/plugins/iconeframe/6/frame.php?lng=fr
">
<font color="#7A7999">Liste des échanges effectués ou en cours</font></a></font></div>

</body>

<!-- Do not change anything below this line -->

<?php
}
?>
</body>
</html>
optimal-effect
frontpage mioche
frontpage mioche
Messageaide pour du codage , Posté le: 01-02-2010 7:17

Bonjour,

Petite erreur dès la 3ème ligne, tu as oublié un quote
<meta content="text/html>

Bon je ne vais pas parler sécurité... surtout pour l'envoie du fichier mais pour ton souci, il manque des headers, voici un minimum :

$to = "e-mail_du_destinataire";
$sujet = "Echange du Sel Tôtout'arts";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=ISO-8859-1" . "\r\n";
$headers .= "From: e-mail_expediteur" . "\r\n";
mail($to, $sujet, $msg, $headers);
Montrer les messages depuis:   
Poster un nouveau sujet sur Création site web   Répondre au sujet à Création site web:aide pour du codage    Accueil Forum -> Création site web Toutes les heures sont au format GMT + 1 Heure
Page 1 sur 1

 
Sauter vers:  
S'enregistrerS'enregistrer
ProfilProfil
Se connecter pour vérifier ses messages privésSe connecter pour vérifier ses messages privés
RechercherRechercher
Liste des MembresMembres
FAQFAQ
ConnexionConnexion 


© Mentions Légales