تبلیغات :
آکوستیک ، فوم شانه تخم مرغی، صداگیر ماینر ، یونولیت
دستگاه جوجه کشی حرفه ای
فروش آنلاین لباس کودک
خرید فالوور ایرانی
خرید فالوور اینستاگرام
خرید ممبر تلگرام

[ + افزودن آگهی متنی جدید ]




نمايش نتايج 1 به 1 از 1

نام تاپيک: مشکل جستجو نشدن کلمات فارسی

  1. #1
    در آغاز فعالیت
    تاريخ عضويت
    Apr 2016
    پست ها
    1

    پيش فرض مشکل جستجو نشدن کلمات فارسی

    با سلام دوستان عزیز من سورس دیکشنری PHP رو گرفتم که انگلیسی به فارسی هست و فقط انگلیسی به فارسی رو معنی میکنه و من میخوام این رو به دیکشنری فارسی به فارسی تبدیلش کنم. فایل txt که معانی و کلمات هست تغییر میدم کلمه و معنی فارسی میزارم اما کلمه فارسی رو تبدیل نمیکنه فقط انگلیسی به فارسی. کسی میتونه کمک کنه؟؟؟
    اینم کد PHP:
    <?
    // {65_122 }-92_96
    $word='';
    if(!isset($_REQUEST['word'])){

    //<form method="post" action="" ><input name=word value="'.$word .'"><input type=submit value=translate ><p>
    echo '

    <html>
    <head>
    <script type="text/javascript">
    var xmlhttp

    function loadXMLDoc(url)
    {
    xmlhttp=null
    // code for Mozilla, etc.
    if (window.XMLHttpRequest)
    {
    xmlhttp=new XMLHttpRequest()
    }
    // code for IE
    else if (window.ActiveXObject)
    {
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
    }
    if (xmlhttp!=null)
    {
    document.getElementById("T1").innerHTML=" <b>لطفا صبر کنید ...</b>"
    xmlhttp.onreadystatechange=state_Change
    xmlhttp.open("GET",url,true)
    xmlhttp.send(null)
    }
    else
    {
    alert("Your browser does not support XMLHTTP.")
    }
    }

    function state_Change()
    {
    // if xmlhttp shows "loaded"
    if (xmlhttp.readyState==4)
    {
    // if "OK"
    if (xmlhttp.status==200)
    {
    document.getElementById("T1").innerHTML=xmlhttp.re sponseText
    }
    else
    {
    // alert("Problem retrieving data:" + xmlhttp.statusText)
    }
    }
    }

    </script>







    <input name="word" onkeyup="loadXMLDoc(\'?&word=\'+this.value)">


    <div id="T1" style="border:1px solid black;height:40;width:300"></div><br />
    </head>



    </body>

    </html>
    ';
    }

    if(isset($_REQUEST['word'])){
    $word=$_REQUEST['word'];
    if ($word==''){$word="1";}
    if (
    ord($word[0])>64 and
    ord($word[0])<123 and
    ord($word[0])!=92 and
    ord($word[0])!=93 and
    ord($word[0])!=94 and
    ord($word[0])!=95 and
    ord($word[0])!=96){
    $data=implode('',file($word[0].'.txt'));
    $se1=strpos($data,$word,1);
    $se3=strpos($data,"\n",$se1+1);
    $len=$se3-$se1;
    if ($len<=0 or $se1<=0){
    $word=substr($word,0,strlen($word)-1) ;
    echo '<p>پیدا نشد.';



    if (strpos($di1,"Did you mean:",1)){

    $beh1= strpos($di1,"Did you mean:",1);
    $beh2= strpos($di1,"<b><i>",$beh1)+6 ;
    $beh3= strpos($di1,"</i></b>",$beh2);
    $beh3=$beh3-$beh2;
    $d12= $beh2;
    echo '<br>Did you mean: <font color=blue><b><a style="CURSOR: hand" onclick="word.value=\''.substr($di1,$d12,$beh3).'\ ';loadXMLDoc(\'?&word=\'+\''.substr($di1,$d12,$beh 3).'\')" >'.substr($di1,$d12,$beh3)."</a>" ;
    }





    }else{

    $bace_data= substr($data,$se1,$len);

    $bace_data= str_replace('|',
    ': <font color=#00c100 size=5>',
    $bace_data) ;


    $part1=substr($bace_data,strlen($word));
    echo '<b>'.$word.'</b>'.$part1;

    //echo $bace_data;
    }
    }else{
    echo '!';
    }
    }


    ?>
    Last edited by alifs71; 22-10-2016 at 17:15.

Thread Information

Users Browsing this Thread

هم اکنون 1 کاربر در حال مشاهده این تاپیک میباشد. (0 کاربر عضو شده و 1 مهمان)

User Tag List

قوانين ايجاد تاپيک در انجمن

  • شما نمی توانید تاپیک ایحاد کنید
  • شما نمی توانید پاسخی ارسال کنید
  • شما نمی توانید فایل پیوست کنید
  • شما نمی توانید پاسخ خود را ویرایش کنید
  •