发布操作后的浏览器后退按钮行为

I have the following website "cards.php":

<body>
<div onclick="hideOverlay()" id="overlay">
    <div class="inputClass" onclick="event.stopPropagation()">
        <form id="cardForm" method="post" action="./config/putData.php">
            <input id="firstInput" type="text" name="front" placeholder="Frage"/>
            <textarea id="back" type="text"  name="back" placeholder="Antwort"></textarea>
            <input type="submit" name="submit" value="Erstellen"/>
            <input type="hidden" name="cat" value="<?php echo $_GET["cat"]?>">
            <input type="hidden" name="sub" value="<?php echo $_GET["sub"]?>">
        </form>
    </div>
    <div id="cardText" class="inputClass" style="width: 50%; min-height: 30%;">
        <div id="topText" class="top">Antwort</div>
        <div id="currentText" class="bottom" style="font-size: 1.5em;"></div>
    </div>
</div>
<main>
  <?php 
   if(isset($_SESSION["id"]) && isset($_GET["cat"]) && isset($_GET["sub"])) {
    $i = 0;
    foreach((new SimpleXMLElement($_SESSION['xml']))->category[(int)$_GET["cat"]]->subcategory[(int)$_GET["sub"]] as $card) {
        echo "<section onClick=\"showCard(" .(int)$_GET["cat"] . ", " . (int)$_GET["sub"] . ", " . $i . ", 2)\">" . $card['front'] . "</section>";
        $i++;
    }
    echo "<section onclick=\"createCard()\">+</section>";
   } else {
    header('Location: index.php');
   }
  ?>
</main>

And this php script "putData.php":

<?php
session_start();
require("settings.php");
if(isset($_SESSION["id"]) && isset($_SESSION["xml"])) {

    $xml = new SimpleXMLElement($_SESSION['xml']);

    if(isset($_POST["cat"]) && isset($_POST["sub"]) && isset($_POST["front"]) && isset($_POST["back"])) {   
        $cat = $_POST['cat'];
        $sub = $_POST['sub'];
        $question = $_POST['front'];
        $answer = $_POST['back'];

        $subcategory = $xml->xpath("category")[$cat]->xpath("subcategory")[$sub];
        $newCard = $subcategory->addChild("card");
        $newCard->addAttribute("front", $question);
        $newCard->addAttribute("back", $answer);
    }
    $xml->asXML($xmldic . "flashcards_" . $_SESSION["id"] . ".xml");
    $_SESSION['xml'] = $xml->asXML();
    header("Location: " . $_SERVER["HTTP_REFERER"]);
    } else {
    header("Location: index.php");
}
?>

After he user has put in something in the form and pressed the submit button, the php script is executed. It writes the input in a xml file and also updates the the session variable 'xml'. After successfuly doing this, the script takes the user back to the previous site "cards.php". This works as intended. The problem is now that the user has to press the back button on the browser twice to get to the site he was on before "cards.php". How can i prevent this? The browser should not save the "putData.php" as a visited site in its history.