• Hi, i got this java code

     $('#gonder').click(function(){
     var plaka_degiskeni = $('#plaka').val();
     var sifre_degiskeni = $('#sifre').val();
     $.ajax({ 
     type:'POST', 
     url:'sonuc.php',
     data: { plaka: plaka_degiskeni, sifre: sifre_degiskeni },
     success:function(cevap){
     $("#sonuc").html(cevap); 
     }
     });
     });
    

    and i got this sonuc.php code

    <?php
    header("Content-Type: text/html; charset=Windows-1254");
    mysql_connect("localhost","***","***");
    mysql_select_db("***");
    mysql_query("SET NAMES 'latin5'"); 
    $plaka=iconv("UTF-8", "ISO-8859-9",$_POST['plaka']);
    $plaka=str_replace(" ","",$plaka);
    $sifre=iconv("UTF-8", "ISO-8859-9",$_POST['sifre']);
    $sifre=str_replace(" ","",$sifre);
    if ($sifre == "***"){
    $sorgu = mysql_query("SELECT * FROM Sayfa1 WHERE PLAKA LIKE '$plaka'");
    }else{
    $sorgu = mysql_query("SELECT * FROM Sayfa1 WHERE PLAKA LIKE '$plaka' AND KAYIT LIKE '$sifre'");
    }
    $veri=0;
    while($r=mysql_fetch_array($sorgu))
    {    
        $veri++;
        $servis=$r["SERVIS"];
        $dosya=$r["DOSYA"];
        $durum=$r["DURUM"];
        $plaka=$r["PLAKA"];
        $sigorta=$r["SIGORTA"];
        $kargo=$r["KARGO"];
        $kargo=str_replace("\n",'<br>',$kargo);
    ?> 
    <table> 
    <tr> 
    <td width="30%"> 
    <?php 
        echo "<b>PLAKA</b> <td>$plaka";
    ?> 
    </td> 
    </tr> 
    <tr> 
    <td> 
    <?php 
        echo "<b>DOSYA NO</b><td> $dosya";
    ?> 
    </td> 
    </tr>
    <tr> 
    <td> 
    <?php
        echo "<b>DOSYA DURUMU</b><td> $durum"; 
    ?> 
    </td> 
    </tr> 
    <tr> 
    <td> 
    <?php
        echo "<b>SYGORTA TYRKETY</b><td> $sigorta"; 
    ?> 
    </td> 
    </tr> 
    <tr> 
    <td> 
    <?php 
        echo "<b>SERVYS</b><td> $servis";
    ?> 
    </td> 
    </tr> 
    <tr> 
    <td> 
    <?php 
        echo "<b>DOSYA NOTU</b><td>$kargo";
    ?> 
    </td> 
    </tr> 
    <td> 
    </td> 
    </table> 
    <?php
    }
    if ($veri==0){
    
    function test_input($data) {
        $data = trim($data);
        $data = stripslashes($data);
        $data = htmlspecialchars($data);
        return $data;
      }
     
    
    if (empty($_POST["plaka"])) {
    ?>    
    <table> 
    <tr> 
    <td width="30%">
    <?php    
        echo "<b>PLAKA ALANI ZORUNLUDUR</b>";
    ?>
    </td> 
    </tr> 
    <td>
    </td> 
    </table> 
    <?php
      } else {
          
        if (empty($_POST["sifre"])) {
    ?>
    <table> 
    <tr> 
    <td width="30%">
    <?php
        echo "<b>TYFRE ALANI ZORUNLUDUR</b>";
    ?>
    </td> 
    </tr> 
    <td> 
    </td> 
    </table> 
    <?php    
      } else {
    ?>
    <table> 
    <tr> 
    <td width="30%">
    <?php      
          echo "<b>PLAKA YADA TYFRE HATALIDIR</b>";
    ?>
    </td> 
    </tr> 
    <td>
    </td> 
    </table> 
    <?php    
      }
      }
    }
     
    ?>

    Its working fine on php ver.5.6 but when I change php to 8.2 it`s not working anymore…?

    What to change in this code to make it run on php 8.2 ? Im sorry but I’m not a programmer. Thanks for any help

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • @ajan83 you need to check error log and browser console for exact error message. If you could provide that error message, i am sure someone will be able to correct the code.

    Thread Starter ajan83

    (@ajan83)

    The following error appears in the browser console

    Uncaught TypeError: $ is not a function
    at script1.js:1:2

    wordpress page code:

    <html><title>bla bla</title><label>Plaka:</label>
    <input id="plaka" style="width: 130px; height: 35px;" name="plaka" size="12" type="text" placeholder="Plaka Giriniz." />
    <label>?ifre:</label>
    <input id="sifre" style="width: 130px; height: 35px;" name="sifre" size="12" type="password" placeholder="?ifre Giriniz." />
    <input id="gonder" style="width: 130px; height: 35px;" name="submit" type="submit" value="DOSYA ARA" />
    <span id="sonuc"></span>
    [contact-form-7 id="385" title="Soru Sor"]
    <script src="https://code.jquery.com/jquery.js"></script>
    <script type="text/javascript" src="script1.js" defer></script>
    </body>
    </html>
    
    Thread Starter ajan83

    (@ajan83)

    i replace $ to jQuery

    after error :

    script1.js:2 Uncaught TypeError: $ is not a function
    at HTMLInputElement. (script1.js:2:24)
    at HTMLInputElement.dispatch (jquery.min.js?ver=3.6.4:2:43184)
    at y.handle (jquery.min.js?ver=3.6.4:2:41168)

    Thread Starter ajan83

    (@ajan83)

    SOLVE:

    <?php
    header("Content-Type: text/html; charset=Windows-1254");
    $mysqli = new mysqli("***","***","***");
    $mysqli->select_db("***");
    $mysqli->set_charset("latin5");
    $plaka = $_POST['plaka'];
    $plaka = str_replace(" ", "", $plaka);
    $plaka = mb_convert_encoding($plaka, "ISO-8859-9", "UTF-8");
    $sifre = $_POST['sifre'];
    $sifre = str_replace(" ", "", $sifre);
    $sifre = mb_convert_encoding($sifre, "ISO-8859-9", "UTF-8");
    if ($sifre == "***"){
    $query = "SELECT * FROM Sayfa1 WHERE PLAKA LIKE '$plaka'";
    }else{
    $query = "SELECT * FROM Sayfa1 WHERE PLAKA LIKE '$plaka' AND KAYIT LIKE '$sifre'";
    }
    $result = $mysqli->query($query);
    $veri = 0;
    while ($r = $result->fetch_assoc())
    {    
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem after changing PHP versio 5.6 to 8.2’ is closed to new replies.