1

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>';
Muath
  • 4,271
  • 11
  • 39
  • 67
Neda
  • 57
  • 6

2 Answers2

1

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');
Neda
  • 57
  • 6
0

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"

n1kkou
  • 3,026
  • 2
  • 19
  • 30
Abhi
  • 104
  • 5