johnrb87 Posted December 17, 2010 Share Posted December 17, 2010 hi everyone I have a small user & business Directory and for it, I use a .htaccess ReWrite. My .htaccess file looks like RewriteEngine On RewriteRule ^([^/.]+)$ index.php?q=$1 [QSA,L] so basically when I run http://localhost/Johnsons/ then it treats that like http://localhost/index.php?q=Johnsons I then do a PHP Query to find the result, I use the following; print "You looked up $_GET['q']"; $result = mysql_query("SELECT `name` FROM `directory` WHERE `name` = '".$_GET['q']."'"); while($row = mysql_fetch_array($result)) { print $row['name']; } this all works fine. The problem I now have is that I have been sent some new data in a SQL database import file and it contains entries such as Dugāriy T-ī-Corā but when I try and run http://localhost/Dugāriy/ or http://localhost/T-ī-Corā/ it does not return the correct value and instead it either misses characters or it exchanges one character for another, (ā is swapped "a" as an example). It seems this is due to a mix of Special Characters & Accents within words such as ā ū ī I have tried altering the META charset tag without any luck, I have also tried print utf8_encode($_GET['q']); print urlencode($_GET['q']); but nothing seems to work. Any idea on how I can solve this? Thanks very much J Quote Link to comment https://forums.phpfreaks.com/topic/221970-value-not-printing/ Share on other sites More sharing options...
johnrb87 Posted December 17, 2010 Author Share Posted December 17, 2010 Still not having any luck, do I have to assign a encoding type to the .htaccess file or something like that? thanks Quote Link to comment https://forums.phpfreaks.com/topic/221970-value-not-printing/#findComment-1148604 Share on other sites More sharing options...
johnrb87 Posted December 17, 2010 Author Share Posted December 17, 2010 strange, if I try running what I have done, using WAMP on my laptop, then it seems to work ok and picks up special characters etc but it does not seem to work on the web server, I know the server is a Windows machine running PHP, therefore do I need to switch something on within the config file to allow these special characters? Quote Link to comment https://forums.phpfreaks.com/topic/221970-value-not-printing/#findComment-1148665 Share on other sites More sharing options...
johnrb87 Posted December 18, 2010 Author Share Posted December 18, 2010 can anyone help? Quote Link to comment https://forums.phpfreaks.com/topic/221970-value-not-printing/#findComment-1149031 Share on other sites More sharing options...
OOP Posted December 18, 2010 Share Posted December 18, 2010 Did you set the page character set/encoding? Have you tried echoing the data you get from the database directly to see their content? Quote Link to comment https://forums.phpfreaks.com/topic/221970-value-not-printing/#findComment-1149042 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.