javascript - Can't send information to PHP page via ajax jQuery -
i have problem jquery ajax in sending information.
the php code supposed observe hebrew letters , convert them standard arabic letters according transcription rules.
this code (jquery code):
<!doctype html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script> $(document).ready(function() { $("#input").keyup(function() { var input = $("#input").val(); $("#text").load("changetext.php", {input:input}); }); }); </script> </head> <body dir="rtl"> <center> <input type="text" id="input" /> <div id="text"></div> <button id="go">חפש!</button> </center> </body> </html> and php page (where conversion of letters occurs):
<?php $input = $_post['input']; str_replace("א", "ا", $input); str_replace("ב", "ب", $input); str_replace("ג'", "ج", $input); str_replace("ד", "د", $input); str_replace("ד'", "ذ", $input); str_replace("ה", "ه", $input); str_replace("ו", "و", $input); str_replace("ז", "ز", $input); str_replace("ח", "ح", $input); str_replace("ח'", "خ", $input); str_replace("ט", "ط", $input); str_replace("ט'", "ظ", $input); str_replace("י", "ي", $input); str_replace("כ", "ك", $input); str_replace("ל", "ل", $input); str_replace("מ", "م", $input); str_replace("נ", "ن", $input); str_replace("ס", "س", $input); str_replace("ע", "ع", $input); str_replace("פ", "ف", $input); str_replace("צ", "ص", $input); str_replace("ק", "ق", $input); str_replace("ר", "ر", $input); str_replace("ש", "ش", $input); str_replace("ת", "ت", $input); str_replace("ת'", "ث", $input); str_replace("ס'", "ض", $input); str_replace("ט'", "ظ", $input); str_replace("ר'", "غ", $input); str_replace("א'", "ﺀ", $input); echo $input; ?> this code don't work, , don't know why.
i think got encoding problems
go here.
taking link
this reply required answered part 1 of many
step 1
you cannot have multilingual characters in unicode document.. convert document utf-8 documentadvanced editors don't create simple you... go low level... utilize notepad save document mename.html & alter encdoing type utf-8
step 2
mention in html page going utilize such characters by
meta http-equiv="content-type" content="text/html;charset=utf-8" > step 3
when set in characters create sure container tags have next 2 properties set
dir='rtl' lang='ar'
step 4
get characters specific tool\editor or online editor did arabic-keyboard.orgexample
رَبٍّ زِدْنٍي عِلمًاnote: font type, font family, font face setting have no effect on special characters
javascript php jquery ajax
No comments:
Post a Comment