dimanche 30 octobre 2016

redirect to another page

hello guys i have this problem that i couldn't solve the thing is i have two buttons one for delete and the other for edit, the delete is working flawlessly, but edit button doesn't seems to work to make it redirect to a php file + how i can get the meeting name with edit button when it's redirect to another page don't know how here's my code

 <table class="table table-striped custab" >
  <thead>
    <tr>
      <th>Title</th>
      <th>Chairman</th>
      <th>Summary</th>
      <th> Date &   Time</th>
    </tr>
    <?php

        $findMeetings = "SELECT * FROM `meeting` WHERE chairman='".$name."'";

        $result = mysqli_query($db, $findMeetings);

        $numRows = mysqli_num_rows($result);

        if($numRows == 0){

            $empty = "<div class='alert alert-danger'>You are currently managing no meetings!</div>";

        }
        else{

            $x = 0;

            while($rows = mysqli_fetch_array($result)){

                $title = $rows['title'];
                $chairman = $rows['chairman'];
                $date = $rows['time'];
                $summary = $rows['summary'];

                $meeting = "
                <tr>
                <th>".$title."</th>
                <th>".$chairman."</th>
                <th>".$summary."</th>
                <th>".$date."</th>
                <th><form method='post'>
                    <input type='submit' class='btn btn-success' name='edit".$x."' value='Edit'/>
                    <input type='submit' class='btn btn-danger' name='delete".$x."' value='Delete'/>
                </form></th>
                </tr>
                ";

                echo $meeting;

                if(isset($_POST['delete'.$x.''])){

                    $query = "DELETE FROM meeting WHERE title='".$title."' LIMIT 1";

                    if($result = mysqli_query($db, $query)){

                        header("Location:managemeeting.php");

                    }

                }



            }

        }

    ?>

  </thead>
  <tbody>

  </tbody>
</table>

so how to get the meeting name and the passed it to editmeeting.php cause there's multiple data.




Aucun commentaire:

Enregistrer un commentaire