Domanda

I have a delete page, I am trying to get an alert message to popup If the delete operation was performed, Display. I want to show text message in alert box in Persian (Farsi) language, but This code is done but Persian characters do not display correctly. please help me What should I do?

 echo '<script>';
 echo 'alert("حذف");';
 echo 'location.href="Delete Touristplace1.php"';
 echo '</script>';
È stato utile?

Soluzione

I found my answer:

Set UTF-8 as the character set for all headers output by your PHP code

In every PHP output header, specify UTF-8 as the encoding:

  header('Content-Type: text/html; charset=utf-8');

Altri suggerimenti

You can use a meta tag for the HTML on which you want this alert, you have set the character set which is suitable for persian language. usually following works charset="UTF-8" if this doesn't work, use charset="ISO-8859-1"

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top