<form class="problem-modal" method="POST" action="">
    <h3>Prijavi problem<span onclick="openProblem()">X</span></h3>
    <textarea name="message" placeholder="Napišite poruku..." required></textarea>
    <?php if($_SESSION['username'] == 'mario') { ?><a href="pregled-prijava">PREGLEDAJ</a><?php } ?>
    <input type="submit" name="problem-submit" value="POŠALJI">
</form>

<?php
    if ($dbc && isset($_POST['problem-submit'])) {
        $user = $_SESSION['username'];
        $message = $_POST['message'];
        $query = "INSERT INTO problems (user, report) VALUES ('$user','$message')";
        $result = mysqli_query($dbc,$query) or die('Error querying database.');
        header("Refresh:0");
        mysqli_close($dbc);
    }
?>