Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1026 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  accent aigu !!!

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

accent aigu !!!

n°1485622
annik
Posté le 03-12-2006 à 15:11:07  profilanswer
 

Bonjour!
J'ai trouvé un tuto pour insérer un Guestbook ...Tout est OK, à part un détail qui me dérange: le message posté "mange" les é et les remplace par un point. Je mets ici le .php
<?php
 
$Submit    = $_POST["Submit"];
$Name      = $_POST["Name"];
$Email      = $_POST["Email"];
$Website    = $_POST["Website"];
$Comments    = $_POST["Comments"];
$NumLow    = $_REQUEST["NumLow"];
$NumHigh    = $_REQUEST["NumHigh"];
 
// Replace special characters - you can remove the next 5 lines if wanted.
$Name      = ereg_replace("[^A-Za-z0-9 ]", "", $Name);
$Comments  = ereg_replace("[^A-Za-z0-9 \@\.\/\']", "", $Comments);
$Website    = eregi_replace("http://", "", $Website);
$Website    = ereg_replace("[^A-Za-z0-9 \@\.\/\'\~\:]", "", $Website);
 
// Remove slashes.
$Name      = stripslashes($Name);
$Email      = stripslashes($Email);
$Website    = stripslashes($Website);
$Comments    = stripslashes($Comments);
 
// ###################################################################################
// ########## Reading and Writing the new data to the GuestBook Database #############
 
if ($Submit == "Yes" ) {
// Next line tells the script which Text file to open.
  $filename    = "GuestBook.txt";
 
// Opens up the file declared above for reading  
 
  $fp      = fopen( $filename,"r" );  
  $OldData    = fread($fp, 80000);  
  fclose( $fp );  
 
// Gets the current Date of when the entry was submitted
  $Today      = (date ("l dS of F Y" ));
 
 
  $Input = "Name: <b>$Name</b>
Email: <b><u><a href=\"mailto:$Email\">$Email</a></u></b>
Website: <b><u><a href=\"http://$Website\" target=\"_blank\">$Website</a></u></b>
Comments: <b>$Comments</b><br>
<i><font size=\"-1\">Date: $Today</font>
 
.:::.";
 
/* This Line adds the '&GuestBook=' part to the front of the data that is stored in the text file.  This is important because without this the Flash movie would not be able to assign the variable 'GuestBook' to the value that is located in this text file  */
 
  $New = "$Input$OldData";
 
// Opens and writes the file.
 
  $fp = fopen( $filename,"w" );  
  fwrite($fp, $New, 800000);  
  fclose( $fp );  
echo '&load=loaded&';
}
 
// ###################################################################################
// ######### Formatting and Printing the Data from the Guestbook to the Flash Movie ##
 
 
 
// Next line tells the script which Text file to open.
  $filename = "GuestBook.txt";
 
// Opens up the file declared above for reading  
 
  $fp    = fopen( $filename,"r" );  
  $Data    = fread($fp, 800000);  
  fclose( $fp );
 
// Splits the Old data into an array anytime it finds the pattern .:::.
  $DataArray = split (".:::.", $Data);
 
// Counts the Number of entries in the GuestBook
  $NumEntries = count($DataArray) - 1;
 
  print "&load=loaded&&TotalEntries=$NumEntries&NumLow=$NumLow&NumHigh=$NumHigh&GuestBook=";
  for ($n = $NumLow; $n < $NumHigh; $n++) {
  print $DataArray[$n];
      if (!$DataArray[$n]) {
        Print "<br><br><br><b>No More entries</b>";
 
      exit;
      }
  }
 
?>
Merci de me renseigner!

mood
Publicité
Posté le 03-12-2006 à 15:11:07  profilanswer
 

n°1485624
FlorentG
Unité de Masse
Posté le 03-12-2006 à 15:12:51  profilanswer
 

Question d'encoding...

n°1485638
annik
Posté le 03-12-2006 à 15:51:52  profilanswer
 

mais encore!!!

n°1485669
franzBesac
Posté le 03-12-2006 à 17:25:16  profilanswer
 

annik a écrit :

mais encore!!!


Essai de chercher du côté de htmlentities()


Message édité par franzBesac le 03-12-2006 à 17:34:22

---------------
http://www.chances-de-gagner.fr

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  accent aigu !!!

 

Sujets relatifs
mauvais renvoi des mots avec accentperte accent lors restauration
Perl, XML et problème accentrecherche avec accent ou sans
Problèmes d'accent sous MySqlProblème accent dans requete sql
[C#] Composant Indy et mail avec accent ...probleme d'accent avec formulaire mail
é accent dans un mailtopb accent aigu dans fichier batch
Plus de sujets relatifs à : accent aigu !!!


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR