I am selecting multiple Id from Page1 and sending to Page2 which is working, Now I have to display all id to function name fake_user_archive
for delete. I am getting empty value in the function.
Example:
I have id no 1,5,20,50. I selected from Page1 and sending that id to page2. My code will check the email status if the status is 1 it will call the next function which is called as fake_user_archive
and there email will delete. but I am not getting any value inside the function.
page1.php
This is not my whole code. only for reference.
<?php
while ($stmt->fetch()) {
echo"<input type='checkbox' name='check_list[]' value='".$id."'>";
}?>
Page2.php
switch($_GET['function']) {
case 'checking':checking($conn);break;
default : redirect('index.php');
}
function checking($conn)
{
// loop over checked checkboxes
foreach($_POST['check_list'] as $checkbox) {
//echo $checkbox;//displaying all id
$sql_all="SELECT * FROM `request` WHERE Id='".$checkbox."'";
$result_chk=$conn->query($sql_all);
if (isset($result_chk->num_rows) > 0) {
while($row = $result_chk->fetch_assoc()) {
$r_email_verify=$row['email_verification'];
}
}
if ($r_email_verify == 1) {
fake_user_archive($conn);//calling the function but getting empty
}
else{
other_function();
}
}//foreach
}
function fake_user_archive($conn)
{
// how do i get here all my id which is selected from page1.php
//deactive id here
}