Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Human
- {
- public $Name;
- public $Surname;
- public $Age;
- public $ID;
- }?>
- <?php
- include 'functions.php';
- include 'database.php';
- if(isset($_GET['del']))
- {
- $id = $_GET['del'];
- $query = "DELETE FROM `students` WHERE `students`.`id` = $id";
- mysqli_query($link, $query) or die (mysqli_error($link));
- }
- $matrix = get_students($link);
- ?>
- <form action="" method="post" >
- <?php $Data = new Human;
- foreach ($matrix as $UserParams):
- $Data->ID = $UserParams["id"]?>
- <?=$Data->ID ?> <?=$UserParams["first_name"]?> <?=$UserParams["middle_name"]?> <?=$UserParams["last_name"]?>
- <input type="checkbox" name="deleter[]" value="<?=$UserParams["id"]?>" >
- <td> <a href="index.php?del=<?=$UserParams["id"]?>">delete</a></td>
- <Br>
- <?php ;
- endforeach; ?>
- <input type="submit" name="formSubmit" value="Submit" >
- </form>
- <?php
- if( !empty($_POST['deleter']))
- {
- $id = $_POST['deleter'];
- $N = count($id);
- }
- else $N = 0;
- echo("Вы выбрали $N : ");
- for($i=0; $i < $N; $i++)
- {
- echo($id[$i] . " ");
- }
- /*?del=<?=$UserParams['id']?>"*/
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement