I'm trying to create a game, and when you win (or lose) the game you reach an end-screen.
Since the game works with a max amount of attempts (5), the game ends when the counter reaches 5.
So when you reach the win/lose-screen, you get a button prompt which allows the user to start a new game. Needlessly, the session needs to be killed when pressing that button, so that when it returns to the game page the game is restarted with a fresh counter of 0.
Now my current code of the win-page is as follows.
<?php
session_start();
##error_reporting(0);
##ini_set('display_errors', 0);
?>
<div align="center">
<h1>Gefeliciteerd!<br /></h1>
<?php echo "Het correcte woord is: ";
echo($_SESSION['testen'])?>
<br />
<FORM METHOD="LINK" ACTION="lingtesttesttest.php">
<INPUT TYPE="submit" VALUE="Speel nog een keer!">
</FORM>
</div>
As seen in the code, when you click the button you're linked back to the game PHP... Now I need the added function of it killing the session after pressing the button. I've looked on Stackoverflow, and other forums. But the solutions I have found often go to a different ''killpage''. I don't want that, I want to return right back to the game page.