How to delete the item from table? I am using SESSION.

Discussion in 'PHP' started by aveevan, Jul 19, 2019.

  1. aveevan

    aveevan

    Joined:
    Jul 19, 2019
    Messages:
    1
    Likes Received:
    0
    Here is my code :

    Code (PHP):
    <html>
    <head>

        <style type="text/css">
            table {
                border-collapse: collapse;
                border: 1px solid black;
            }
            table td,th {
                border: 1px solid black;
            }
            td {
                text-align: center;
            }
        </style>
    </head>

    <body>

        <h2>Play Lists</h2>

        <table>
            <th>Voice SKU</th>
            <th>Voice Name</th>
            <th>Action</th>
       

            <?php
           session_start();
          foreach ($_SESSION['playlist'] as $key => $value) {
            echo "<tr>";
            echo "<td>" . $key . "</td>\n<td>" . $value . "</td>";
            echo "<td>". "<button id='btn'>Delete</button>"."</td>";
            echo "</tr>";  
            }

            ?>
        </table>

    </body>
    </html>





     
    output:

    https://snag.gy/vOt9VX.jpg
     
    aveevan, Jul 19, 2019
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.