php_joe Posted November 5, 2006 Share Posted November 5, 2006 Hi,I'm trying to use PHP to create a link with a chinese word in it that will open an iframe.The code that I'm using is this:[code]echo "<a href=\"./rightcard.php?word=$chinese_word\" target=\"iframe\">Link</a>";[/code]In the source code it looks like this:[code]<a href="./rightcard.php?word=动物" target=\"iframe\">Link</a>[/code]If it weren't for an iframe it would look like this in the URL bar:[code]http://test.org/index.php?word=加法[/code]But when I click on it the word comes up as "??"Joe Quote Link to comment Share on other sites More sharing options...
php_joe Posted November 5, 2006 Author Share Posted November 5, 2006 I guess I should make myself more clear:if the link is:[code]index?face=加法[/code]and the following page has:[code]echo "$face";[/code]Why would it output [b]???[/b]And is there anyway to get it to output the chinese word?Thanks!Joe Quote Link to comment Share on other sites More sharing options...
realjumper Posted November 5, 2006 Share Posted November 5, 2006 What is the encoding on the page? Quote Link to comment Share on other sites More sharing options...
btherl Posted November 6, 2006 Share Posted November 6, 2006 How about[code]echo htmlentities($face, ENT_QUOTES, 'UTF-8');[/code]Or, replace 'UTF-8' with one of:BIG5GB2312 BIG5-HKSCS Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted November 6, 2006 Share Posted November 6, 2006 that would be because of the language settings on your encoding, as realjumper pointed out. Quote Link to comment Share on other sites More sharing options...
php_joe Posted November 6, 2006 Author Share Posted November 6, 2006 Thanks everyone, I should have known that... ::)Joe Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.