%PDF- %PDF-
Direktori : /home/medipszd/www/admin/ |
Current File : //home/medipszd/www/admin/users_activate.php |
<?php include 'includes/session.php'; if(isset($_POST['activate'])){ $id = $_POST['id']; $conn = $pdo->open(); try{ $stmt = $conn->prepare("UPDATE users SET status=:status WHERE id=:id"); $stmt->execute(['status'=>1, 'id'=>$id]); $_SESSION['success'] = 'User activated successfully'; } catch(PDOException $e){ $_SESSION['error'] = $e->getMessage(); } $pdo->close(); } else{ $_SESSION['error'] = 'Select user to activate first'; } header('location: users.php'); ?>