Virker stadig ikke med æ, ø og å
Da jeg ikke i mit tidligere spørgsmål fik scriptet til at virke, prøver jeg lige igen da det da for søren må lykkes tilsidst...Jeg sidder med denne her flash/php gæstebog, hvor diverse indlæg bliver smidt ind i et txt dokument, hvorfra det så igen bliver indlæst i Flash'en.
Dette virker OK, men hvis man bruger bogstaverne 'æ' 'ø' elller 'å' springes disse bare over og indlæses ikke
Gæstebogen er et tilpasset script hentet hos flashkit, og selve PHP'en ser således ud --->
<?
############### Begin GuestBook Script #####################################
##The first 3 lines use a regular expression to match a pattern then replace it with nothing. The only reason for this is so we only allow necessary characters to be entered into the guestbook. This also takes out slashes which are sometimes added in the post headers to make the string friendly. You can erase or take these lines out if you want.
$Name = ereg_replace("[^A-Za-z0-9 ]", "", $Name);
$Email = ereg_replace("[^A-Za-z0-9 \@\.\-\/\']", "", $Email);
$Comments = ereg_replace("[^A-Za-z0-9 \@\.\-\/\']", "", $Comments);
$Comments = ereg_replace("æ", "æ", $Comments);
$Comments = ereg_replace("ø", "ø", $Comments);
$Comments = ereg_replace("å", "å", $Comments);
$Comments = ereg_replace("Æ", "Æ", $Comments);
$Comments = ereg_replace("Ø", "Ø", $Comments);
$Comments = ereg_replace("Å", "Å", $Comments);
$Website = eregi_replace("http://", "", $Website);
$Website = ereg_replace("[^A-Za-z0-9 \@\.\-\/\'\~\:]", "", $Website);
$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 ( h:i:s A )",time()));
#Puts the recently added data into html format that can be read into the Flash Movie.
$Input = "Navn: <b>$Name</b><br>Kommentar: <b>$Comments</b><br><i><font size=\"-1\">Dato: $Today</font><br><br>.:::.";
#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, 80000);
fclose( $fp );
}
####################################################################################
########## 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, 80000);
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 "&TotalEntries=$NumEntries&NumLow=$NumLow&NumHigh=$NumHigh&GuestBook=";
for ($n = $NumLow; $n < $NumHigh; $n++) {
print $DataArray[$n];
if (!$DataArray[$n]) {
Print "<br><br><b>Der er ikke flere indlæg</b>";
exit;
}
}
####################################################################################
############### End GuestBook Script
?>
Gæstebogen kan ses her -->
http://www.exciter.dk/feedback.asp