accent aigu !!!

accent aigu !!! - PHP - Programmation

Marsh Posté le 03-12-2006 à 15:11:07    

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!

Reply

Marsh Posté le 03-12-2006 à 15:11:07   

Reply

Marsh Posté le 03-12-2006 à 15:12:51    

Question d'encoding...

Reply

Marsh Posté le 03-12-2006 à 15:51:52    

mais encore!!!

Reply

Marsh Posté le 03-12-2006 à 17:25:16    

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
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed