Kameloh Posted March 4, 2010 Share Posted March 4, 2010 I'm having problems with $_GET for Japanese Characters.Example: Does Not Work: when clicking from a linkhttp://www.nabyn.com/gallery.php?tag={...#12356;いWorks: a <form method="get"> submithttp://www.nabyn.com/gallery.php?tag=%26%2...B%26%2312356%3BEchoing the variable from a link echoes gibberish wheras the second one echoes the values correctly. <?php$tag = trim(addslashes($_GET['tag']));echo 'Debug: '.$tag;// <-- Other Code Checking Here?> Is there some special encoding that I have to do for $_GET variables to behave like <form method="get">?Thank you! Link to comment Share on other sites More sharing options...
justsomeguy Posted March 4, 2010 Share Posted March 4, 2010 If you're putting those characters on the link, you need to escape everything yourself. Submitting a form escapes characters automatically. You can use urlencode to escape your characters for the URL:http://www.php.net/manual/en/function.urlencode.php Link to comment Share on other sites More sharing options...
Kameloh Posted March 4, 2010 Author Share Posted March 4, 2010 Ah thank you - that works with my code.The only problem I have now is that the URLs themselves are long and ugly.. but I'll see what I can do with that.Thank you again Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.