Jump to content

Value not printing


johnrb87

Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.