• 04-09-2019, 11:34:00
    #1
    Merhaba arkadaşlar. Tablomda bir sıralama yapmak istiyorum. Table kodunu form içine aldım row isimli inputu array olarak yolluyorum fakat diğer tarafta php ile postu array olarak alamıyorum.
    <form action="update.php" method="POST">
    <table class="table table-bordered">
    <thead>
    <tr>
    <th>#</th>
    <th>Əmlak Növü</th>
    <th>Siyahı</th>
    <th>Vəzyət</th>
    <th>Sıra</th>
    <th></th>
    </tr>
    </thead>
    <tbody>
    <?php foreach ($rows as $row): $i++; ?>
    <tr>
    <td><?php echo $i; ?></td>
    <td><?php echo $row['name'] ?></td>
    <td><?php echo $row['list']==0 ? "<button class="btn btn-danger">Passiv</button>" : "<button class="btn btn-success">Aktiv</button>" ; ?></td>
    <td><?php echo $row['status']==0 ? "<button class="btn btn-danger">Passiv</button>" : "<button class="btn btn-success">Aktiv</button>" ; ?></td>
    <td><input type="text" name="row[<?php echo $row['id'] ?>]" value="<?php echo $row['row'] ?>" size="10"></td>
    <td>
    <a href="#" class="btn btn-primary">Dəyiş</a>
    <a href="google" class="btn btn-danger" onclick="return confirm('Əmlak növünü silmək istədiyinizə əminsiniz?');">Sil</a>
    </td>
    </tr>
    <?php endforeach ?>
    </tbody>
    </table>
    <button class="btn btn-success navbar-right" name="et_list_row_edit">Yadda Saxla</button>
    </form>
    update.php dosyam

    if (isset($_POST['et_list_row_edit'])) {
    if (isset($_POST['row']) && is_array($_POST['row'])) {
    echo "string";
    }else{
    echo "1";
    }
    }
    geriye 1 döndürüyo
  • 04-09-2019, 11:37:16
    #2
    foreach ($_POST['id'] as $key => $value) {
    echo $value . "<br />";
    }

    kodunuzu bu şekilde ayarlayın hocam
  • 04-09-2019, 11:38:46
    #3
    Arkadaşlar Post olarak işlem yapılmıyor fakat GET olarak yapılıyor. Post ile yaptığımda update.php ile bu dosyam gerek aynı dizinde olsun