Yeah, I have an issue with ÆØÅ randomly being replaced with æØå when loading/refreshing a php page calling on some values...
It worked fine until I added
$Filename = preg_replace("/[^a-zA-Z0-9]/", "", $Filename);
but that caused the script to delete the . in the file extensions, so I removed the code. Now it randomly replaces the letters upon load/refresh
$Filename=$_FILES['Filename']['name'];
$Description=$_POST['Description'];
$Contact=$_POST['Contact'];
$Time = gmdate('Y-m-d H:i');
$Title=$_POST['Title'];
$Filename = preg_replace("/[^a-zA-Z0-9]/", "", $Filename);
if(move_uploaded_file($_FILES['Filename']['tmp_name'], $target)) {
echo "Filen ". basename( $_FILES['Filename']['name']). " er nå lagt til blant Alta Botanikkforeningens funn.";
mysql_connect("localhost", "root", "") or die(mysql_error()) ;
mysql_select_db("altabotanikk") or die(mysql_error()) ;
mysql_query("INSERT INTO picture (Filename,Description,Contact,Time,Title)
VALUES ('$Filename', '$Description', '$Contact', now(), '$Title')") ;
} else {
echo "Det skjedde noe galt her :/";
}
Due to it being random and no errors anywhere, I have no idea what is causing this.
HTML declaring UTF-8
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />