Fonction décode texte dans fichier PHP

BBFUNK01 Messages postés 1310 Date d'inscription jeudi 16 juillet 2009 Statut Membre Dernière intervention 20 juin 2014 - 17 déc. 2009 à 19:33
davidcian Messages postés 186 Date d'inscription vendredi 18 novembre 2005 Statut Membre Dernière intervention 19 décembre 2009 - 18 déc. 2009 à 12:14
Bonjour à toutes et tous,

j'utilise pour mon formulaire e-mail en flash ce script php :
<?php
###############################################################################
#
# E-mail Formular + Autoresponder by Matthias Kannengiesser
# Copyright 2001
# Update: 10.03.2006
#
###############################################################################
#
#
# Mail an Webmaster  ##########################################################
#
# Add your E-mail right here
#
$MailTo="contact@musichrono.com";
#
# Formating Date   ############################################################
#
$nowDay=date("d.m.Y");
$nowClock=date("H:i:s");
#
# Formating Body content ######################################################
#
$FormContent="
Les détails suivants ont été reçus le $nowDay à $nowClock:\n\n
----------------------------------------------------------------------------\n
Nom: $_POST[firstname]\n
Prénom: $_POST[lastname]\n
E-mail: $_POST[MailFrom]\n
----------------------------------------------------------------------------\n
Genre: $_POST[gender]\n
----------------------------------------------------------------------------\n
Téléphone: $_POST[Subject]\n
----------------------------------------------------------------------------\n
Message: $_POST[Body]\n
----------------------------------------------------------------------------\n
";
#
#
mail($MailTo, "$_POST[Subject] (de $_POST[firstname] $_POST[lastname])", $FormContent, "From: $_POST[MailFrom]");
#
#
# Autoresponder   #############################################################
#
#
       $filename = "answer.txt";
       $fd = fopen( $filename, "r" );
       $contents = fread( $fd, filesize( $filename ) );
       fclose( $fd );
       mail( "$_POST[MailFrom]", "ACCUSE DE RECEPTION - MUSICHRONO", "$contents\n\n",
             "From:contact@musichrono.com\n" );
#
#
# Flashsignal Variable   ######################################################
#
#
$signal=1;
echo "signal=$signal";
#
#
###############################################################################
?>


N'étant pas un pro en php, j'aimerais savoir comment je peux intégrer dans ce script la fonction "utf8_decode" pour obtenir un message rédigé corectement.

Merci à tous.

BBFUNK01

1 réponse

davidcian Messages postés 186 Date d'inscription vendredi 18 novembre 2005 Statut Membre Dernière intervention 19 décembre 2009 1
18 déc. 2009 à 12:14
Bon je t'aide si tu m'aides en flash ici:

http://www.flashkod.com/forum/sujet-AS3-INCLUDE-AUTRE-PHP_1385785.aspx

Bon allé je te donne la solution quand même

mail( $_POST[MailFrom], "ACCUSE DE RECEPTION - MUSICHRONO", utf8_decode($contents)."\n\n", "From:contact@musichrono.com\n" );


Les variables n'ont pas besoin d'être encadré par des quotes ;)

Par contre attention, à ta place je rajouterais un "stripslashes" aussi pour envelever "/" qui protège le texte...

Az
0
Rejoignez-nous