<?php
require_once '../element/connection.php';

$user_id = $_SESSION['user_id']; // set this from login
$amount = (int)$_POST['amount'];

if ($amount > 0) {
    $conn->query("INSERT INTO withdrawal_requests (user_id, amount) VALUES ($user_id, $amount)");
    echo "Withdrawal request submitted.";
} else {
    echo "Invalid amount.";
}

?>