Skrypt jest w języku angielskim, dla swoich potrzeb jednak, tłumaczę go na polski, lecz mam problem z obsługą komunikatów w naszym języku.
Poniżej przedstawię jak wygląda problem.
Sprawa dotyczy sytuacji, w której np. podczas rejestracji użytkownik podaje adres email, który już zarejestrowany jest na innym koncie.
Wówczas pojawia się komunikat z informacją o tej sytuacji.
O ile w przypadku braku polskich liter, komunikat wyświetlany jest poprawnie.

To jeśli dorzucę do niego polską literę, komunikat przerywany jest właśnie na tej literze

Poniżej wklejam pierwszą połowę pliku, który wyświetla komunikat:
CODE
session_start();
require_once("inc/config.php");
require_once("lib/cpaint2.inc.php");
require_once ("inc/ftp.class.php");
$link = mysql_connect($db_server, $db_user, $db_password) or die("Could not connect.");
mysql_select_db($db_name) or die("Could not select database.");
function check_input($value)
{
$value = strip_tags($value);
$value = mysql_real_escape_string($value);
//filter all non alphanumeric characters
// allows numbers, letters and spaces only
$value = preg_replace("/[^0-9a-z _-]/i",'', $value);
return $value;
}
$uname=check_input($_POST['uname']);
$pass=check_input($_POST['pass']);
$pass1=check_input($_POST['pass1']);
$pass2=check_input($_POST['pass2']);
$ugid=check_input($_POST['ugid']);
$md5_pass2=md5($pass2);
$r_reporterid=check_input($_POST['r_reporterid']);
$r_uploaderid=check_input($_POST['r_uploaderid']);
$r_timestamp=check_input($_POST['r_timestamp']);
$r_imagename=check_input($_POST['r_imagename']);
$r_ip=check_input($_POST['r_ip']);
$md5_pass=md5($pass);
$validation = $config['EmailValidation'];
$d_filename=check_input($_POST['d_filename']);
if(isset($_COOKIE['cookid'])){
$vid = intval($_COOKIE['cookid']);
$vgid = intval($_COOKIE['cookgid']);
$vname = check_input($_COOKIE['cookname']);
$vpass = check_input($_COOKIE['cookpass']);
$result = mysql_query("select * from users where userid='$vid' and usergid='$vgid' and username='$vname' and password='$vpass'");
if(mysql_num_rows($result) ==0) {
header("Location: logout.php");
exit;
} }
$userid=$_SESSION['userid'];
$usergid=$_SESSION['usergid'];
if (!$userid || empty($userid) || $userid==""){
$userid = $_COOKIE['cookid'];
$usergid = $_COOKIE['cookgid'];
}
function usersignup($uname,$fname,$lname,$email,$pass,$md5_pass,$validation)
{
global $cp, $support_email, $site_name, $server_url, $validation;
$msg="";
$sql="select count(*) as total1 from users where username='$uname'";
$result=mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
$total1=$row['total1'];
}
if($total1)
{
$id="uname";
$msg="Wybierz inny login.";
}
if($msg=="")
{
$sql="select count(*) as total from users where email='$email'";
$result=mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
$total=$row['total'];
}
if($total)
{
$id="email";
$msg="Podany adres email jest juz zarejestrowany.";
}
Oraz plik config.php
CODE
include("db.php");
$link = mysql_connect($db_server, $db_user, $db_password) or die("Could not connect");
mysql_select_db($db_name) or die("Could not select database");
$query = "SELECT * from config";
$result = mysql_query($query) or die("Query failed");
while ($row = mysql_fetch_assoc($result)) {
$config[$row['soption']]=$row['svalue'];
}
$site_name = $config['SiteName'];
$sql="select * from users where userid='1'";
$result = mysql_query($sql) or die("Query failed.");
while ($row = mysql_fetch_array($result))
{
$support_email=$row['email'];
}
$server_url = $config['SiteUrl'];
// config options
$version = $config['ScriptVersion'];
$uploads = $config['Uploads'];
$registration = $config['MemberRegistration'];
$validation = $config['EmailValidation'];
$ads = $config['Advertisements'];
$watermarking = $config['Watermarking'];
$HotLink = $config['Hotlinking'];
// thumbnail settings
$dest_height = $config['ThumbHeight'];
$dest_width = $config['ThumbWidth'];
$server_root = $config['SiteRoot'];
$server_directory = "";
$server_save_directory = $server_directory . "/images/"; // /folder/
// do not change the following variables
global $server_dir;
$server_dir = $server_root . $server_save_directory;
$page_url = $server_url . $server_directory;
$image_url = $server_url . $server_save_directory;
$valid_mime_types_display = $config['Extension'];
$valid_file_ext=explode(",",$config['Extension']);
function getSize ($imageurl)
{
if ( intval(phpversion()) < 5 )
die ( 'PHP5 Required' );
$headers = get_headers($imageurl, 1);
return $headers['Content-Length'];
}
// Convert a URL to the local file path and vice versa, convert a local file path to a URL.
// this sets the sytem / or \ :
strstr( PHP_OS, "WIN") ? $slash = "\\" : $slash = "/";
// This is the location of the php file that contains this
// function. Usually this request is made to files/folders
// down the directory structure, so the php file that
// contains these functions is a good "where am i"
// reference point:
$WIMPY_BASE['path']['physical'] = getcwd();
$WIMPY_BASE['path']['www'] = "http://".$_SERVER['HTTP_HOST'];
function url2filepath($theURL){
global $WIMPY_BASE, $slash;
$AtheFile = explode ("/", $theURL);
$theFileName = array_pop($AtheFile);
$AwimpyPathWWW = explode ("/", $WIMPY_BASE['path']['www']);
$AtheFilePath = array_values (array_diff ($AtheFile, $AwimpyPathWWW));
if($AtheFilePath){
$theFilePath = $slash.implode($slash, $AtheFilePath).$slash.$theFileName;
} else {
$theFilePath = implode($slash, $AtheFilePath).$slash.$theFileName;
}
return ($WIMPY_BASE['path']['physical'].$theFilePath);
}
function filepath2url ($theFilepath){
global $WIMPY_BASE, $slash;
$AtheFile = explode ($slash, $theFilepath);
$theFileName = array_pop($AtheFile);
$AwimpyPathFILE = explode ($slash, $WIMPY_BASE['path']['physical']);
$AtheFilePath = array_values (array_diff ($AtheFile, $AwimpyPathFILE));
$thFileURL = implode("/", $AtheFilePath)."/".$theFileName;
return ($WIMPY_BASE['path']['www']."$thFileURL");
}
?>
$link = mysql_connect($db_server, $db_user, $db_password) or die("Could not connect");
mysql_select_db($db_name) or die("Could not select database");
$query = "SELECT * from config";
$result = mysql_query($query) or die("Query failed");
while ($row = mysql_fetch_assoc($result)) {
$config[$row['soption']]=$row['svalue'];
}
$site_name = $config['SiteName'];
$sql="select * from users where userid='1'";
$result = mysql_query($sql) or die("Query failed.");
while ($row = mysql_fetch_array($result))
{
$support_email=$row['email'];
}
$server_url = $config['SiteUrl'];
// config options
$version = $config['ScriptVersion'];
$uploads = $config['Uploads'];
$registration = $config['MemberRegistration'];
$validation = $config['EmailValidation'];
$ads = $config['Advertisements'];
$watermarking = $config['Watermarking'];
$HotLink = $config['Hotlinking'];
// thumbnail settings
$dest_height = $config['ThumbHeight'];
$dest_width = $config['ThumbWidth'];
$server_root = $config['SiteRoot'];
$server_directory = "";
$server_save_directory = $server_directory . "/images/"; // /folder/
// do not change the following variables
global $server_dir;
$server_dir = $server_root . $server_save_directory;
$page_url = $server_url . $server_directory;
$image_url = $server_url . $server_save_directory;
$valid_mime_types_display = $config['Extension'];
$valid_file_ext=explode(",",$config['Extension']);
function getSize ($imageurl)
{
if ( intval(phpversion()) < 5 )
die ( 'PHP5 Required' );
$headers = get_headers($imageurl, 1);
return $headers['Content-Length'];
}
// Convert a URL to the local file path and vice versa, convert a local file path to a URL.
// this sets the sytem / or \ :
strstr( PHP_OS, "WIN") ? $slash = "\\" : $slash = "/";
// This is the location of the php file that contains this
// function. Usually this request is made to files/folders
// down the directory structure, so the php file that
// contains these functions is a good "where am i"
// reference point:
$WIMPY_BASE['path']['physical'] = getcwd();
$WIMPY_BASE['path']['www'] = "http://".$_SERVER['HTTP_HOST'];
function url2filepath($theURL){
global $WIMPY_BASE, $slash;
$AtheFile = explode ("/", $theURL);
$theFileName = array_pop($AtheFile);
$AwimpyPathWWW = explode ("/", $WIMPY_BASE['path']['www']);
$AtheFilePath = array_values (array_diff ($AtheFile, $AwimpyPathWWW));
if($AtheFilePath){
$theFilePath = $slash.implode($slash, $AtheFilePath).$slash.$theFileName;
} else {
$theFilePath = implode($slash, $AtheFilePath).$slash.$theFileName;
}
return ($WIMPY_BASE['path']['physical'].$theFilePath);
}
function filepath2url ($theFilepath){
global $WIMPY_BASE, $slash;
$AtheFile = explode ($slash, $theFilepath);
$theFileName = array_pop($AtheFile);
$AwimpyPathFILE = explode ($slash, $WIMPY_BASE['path']['physical']);
$AtheFilePath = array_values (array_diff ($AtheFile, $AwimpyPathFILE));
$thFileURL = implode("/", $AtheFilePath)."/".$theFileName;
return ($WIMPY_BASE['path']['www']."$thFileURL");
}
?>
Pomyślałem, że problem bierze się z nieprawidłowego kodowania znaków, więc za pomocą manuala, którego znalazłem na forum, w phpMyAdmin zmieniłem kodowanie bazy na poniższe.

Lecz niestety nie przyniosło to skutku.
Czy jesteście w stanie powiedzieć mi co muszę zmienić i gdzie, aby komunikat z polskimi literami nie był ucinany na pierwszej polskiej literze, lecz wyświetlany w całości...?