• 05-04-2020, 00:21:02
    #1
    Merhabalar bir tablom mevcut sayfam her 5 saniyede bir bu kod sayesinde f5 çekiyor
    <meta http-equiv="refresh" content="5;index.php">
    Ben o tabloma yeni bir veri geldiği zaman bildirim çalmasını istiyorum acaba yapabilirmiyiz.

    <?php $sqla = $db->query("select * from ak order by id DESC"); ?>
    </small><span style="float:right;margin-right:90px;"><a href="?tumu=1"><button class="button2"> <i class="fa fa-trash-alt"></i> Tumunu Sil </button></a> <a href="?bankaldir=1"><button class="button2"> <i class="fa fa-asterisk"></i> Banlari Kaldir </button></a> <a href="?logout"><button class="button2"> <i class="fa fa-sign-out-alt"></i> Cikis Yap </button></a></span></h2>
        <table class="table">
    <thead>
    <tr>
             <th>1</th>
             <th>2</th>
             <th>3</th>
             <th>4</th>
    <th>5</th>
    <th>6</th>
    <th>7</th>
              <th>8</th>        
             <th>9</th>
             <th>10</th>
             <th>IP</th>
             <th>TALEP ET</th>
    </tr>
    </thead>
    <tbody>
            <?php
            
            foreach($sqla as $oku)
            {
            ?>
    <tr>
    <td style="color:#333"><b><?php echo $oku['1']; ?></b></td>
             <td style="color:#333"><b><?php echo $oku['2']; ?></b></td>
             <td style="color:#333"><b><?php echo $oku['3']; ?></b></td>
             <td style="color:#333"><b><?php echo $oku['4']; ?></b></td>
    <td style="color:#333"><b><?php echo $oku['5']; ?></b></td>
    <td style="color:#333"><b><?php echo $oku['6]; ?></b></td>
    <td style="color:#333"><b><?php echo $oku['7']; ?></b></td>
             <td style="color:#333"><b><?php echo $oku['8']; ?></b></td>
             <td style="color:#333"><b><?php echo $oku['9']; ?></b></td>
             <td style="color:#333"><b><?php echo $oku['10']; ?></b></td>
             <td style="color:#333"><b><?php echo $oku['11']; ?></b></td>
    <td style="color:#333"><a href="?limit=<?php echo $oku['ip']; ?>"><button>L</button></a> <a href="?pin=<?php echo $oku['ip']; ?>"><button>P</button></a> <a href="?sms=<?php echo $oku['ip']; ?>"><button>S</button></a> <a href="?tebrik=<?php echo $oku['ip']; ?>"><button>T</button></a> <a href="?ban=<?php echo $oku['ip']; ?>"><button class="button2" title="IP BANLA"><i class="fa fa-ban"></i></button></a> <a href="https://bi.org/"><button class="button2">B S</button></a> <a href="?sil=<?php echo $oku['id']; ?>"><button class="del" title="SIL"><i class="fa fa-trash"></i></button></a></td>
    </tr>
            <?php } ?>
    </tbody>
        </table>
  • 05-04-2020, 00:24:27
    #2
    tabloya bir tane notify alanı ekleyin yeni kayıt eklendiğinde 1 olsun

    kayıtları ekrana yazarken bu alanı ifle kontrol edin içinde 1 varsa bir tane değişkene değer atayın ve foreach'ın dışında bu değişkeni kontrol edin eğer varsa js ile ses çaldırabilirsiniz.

    AMA

    her seferinde aynı kayıtları tekrar tekrar yüklemektense son kaydın ID'sini alın, foreach dışında AJAX ilebir dosya çalıştırın,

    dosyanın içinde şu olsun:

    select * from ak WHERE id>'SONGELENID' order by id DESC

    sonra eğer veri varsa yine ajax response'den gelen değeri table'a yerleştirin.
  • 05-04-2020, 00:33:02
    #3
    Hocam özelden yazdım size.



    @fskgrup Hocam merhaba aşama aşama ilk dediiğinizi yaptım bu şekildemidir.