<?php
session_start();
if (!isset($_SESSION['admin'])) {
    header("Location: index.php");
    exit();
}
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['upi'])) {
    $upi = trim($_POST['upi']);
    file_put_contents('data/upi2.txt', $upi);
    header("Location: dashboard.php");
    exit();
}
?>
