Quote:
Originally Posted by vietkieu_cz
Hi everybody,
I've tried some PHP codes by http://www.w3schools.com/php/php_if_else.asp
I wrote a page in UTF-U (Unicode) and it shows a blank page
then I try in ISO-8859-1 then the page shows all.
=> Page in Unicode => is blank
PHP Code:
<html><head><title>C?ng nghe th?ng tin VN</title> </head> <body> <?php $nd=$_GET['t']; $noiquy = "Đọc nội quy của VNIT!"; if ($nd=="") echo "Trang chu VNIT"; elseif ($nd=="noiquy") echo "$noiquy"; else echo "Error"; ?> </body> </html>
-------------- and page wrote in none-unicod
PHP Code:
<html><head><title>Cong nghe thong tin VN</title> </head> <body> <?php $nd=$_GET['t']; $noiquy = "Doc noi quy cua VNIT!"; if ($nd=="") echo "Trang chu VNIT"; elseif ($nd=="noiquy") echo "$noiquy"; else echo "Error"; ?> </body> </html>
please help me how to write in Unicode ?
thank you and sorry for my bad English :surprised:
|
Your English is good, don't worry! What version of PHP are you using?
I just tried it out to see if the unicode text would appear. I changed it a bit so the variable would show up.
http://www.oishii-sushi.com/tiengviet.php
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>C?ng nghe th?ng tin VN</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<?php
$nd=$_GET['t'];
$noiquy = "Đọc nội quy của VNIT!";
if ($nd!="")
echo "Trang chu VNIT";
elseif ($nd!="noiquy")
echo "$noiquy";
else
echo "Error";
?>
</body>
</html>