I have problems with php when variables are assigned utf8 values. For example, I have 2 scripts:
script1:
<?php
$var = "джиган";
echo '<a href="test2.php?var='.$var.'">test</a>';
?>
script2:
<?php
$var = $_GET['var'];
echo $var;
?>
Edit: I do not think the error is with displaying in browser, so methods like:
header('Content-Type: text/html; charset=utf-8');
do not work. I have tested above scripts on 2 servers: on localhost and on shared hosting. Problem occurs on shared hosting. I guess the problem with server configurations.
When I call script 2 from link in script 1 my server gives me the following error:
Forbidden
You don't have permission to access /agayan/test2.php on this server.
What can be the problem?
Hope this might help you
<?php
$var = "джиган";
echo '<a href="test2.php?var='.$var.'">test</a>';
?>
and your second script should be
<?php
header('Content-Type: text/html; charset=utf-8');
$var = $_GET['var'];
echo $var;
?>
and your global directory settings should be like (httpd.conf line ~188):
<Directory />
AllowOverride All
Order deny,allow
Allow from all
</Directory>