when selling my game online, it happens after the payment stage where the PHP generates the serial for the game. But on this page, the user can, alas, refresh the page and generate other serails (as many he wants).
How to block this?
THANKS
!i!i!i!i!i!i!i!i!i! !i!i!i!i!i!i! !i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits Version de PB : 6.12LTS - 64 bits
It's usually done with $_SESSION, create a session check if a code already exist otherwise save a code. A little more complex than that but there are scripts that do this, check in https://stackoverflow.com
<?php
session_start();
if (isset($_SESSION['randomcode']){
header('location:/index.php');
exit;
}
$_SESSION['randomcode']=rand(10000,99999);
// rest of your code
?>
More or less an example ( a lot less than more)
Norm.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
NicTheQuick wrote: Thu Apr 13, 2023 9:01 am
Don't you write the serial into a database?
I write the serials in a file.
---
Yesterday, I asked chatGPT how to prevent the refresh of the PHP page and it told me 2 "headers" that I put in the PHP page but, alas, we can still refresh..
PHP: