%PDF- %PDF-
Direktori : /home/medipszd/public_html/admin/ |
Current File : /home/medipszd/public_html/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'); ?>