Arabic query string - URL not saved and displayed

I am trying to make my SEO links friendly by adding a date and title. However, some of the names are in Arabic. The British work great, but the Arab ones don't. Example:

ØŽØ§Ų„Ø¯-ØšŲ„Ų‰ -20120923220529. HTML

Following this tutorial , I created this code:

$title=mysql_real_escape_string($_POST['title']); 

I have an error with the insert header and the URL was not inserted with the Arabic character and when deleting this code the insert did not occur, but when this URL is selected from the database it will not be redirected 404 I need t show my links

http://dzeduc.org/%D8%A7%D9%84%D9%85%D8%B9%D8%A7%D8%AF%D9%84%D8%A7%D8%AA-%D9%88- % D8% A7% D9% 84% D9% 85% D8% AA% D8% B1% D8% A7% D8% AC% D8% AD% D8% A7% D8% AA-% D9% 85% D9% 86- % D8% A7% D9% 84% D8% AF% D8% B1% D8% AC% D8% A9-1% D9% 882 /

How can I solve this problem?

Note

 $conn = mysql_connect($db_host,$db_user,$db_pass) or die(mysql_error()); mysql_select_db($db_name,$conn); mysql_query("SET NAMES 'utf8'"); mysql_query('SET CHARACTER SET utf8'); 

Meta tags

 <meta charset="UTF-8" /> <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" /> 
+6
source share
1 answer

You must fix 3 problems:

1. Edit the Article.php code to:

 $url = urldecode( mysql_real_escape_string($_GET['url']) ); 

2. Make sure your sorting url fields are utf_general_ci

3. Edit the .htaccess file to:

 RewriteEngine On RewriteRule ^(.*).html$ article.php?url=$1 
+2
source

All Articles