what my code does now is its posting the session in the database and everytime I refresh this page it keeps posting the same session again and again. I don't get why? The solution is probably a simple one but I tried everything. Hope to get some help.
<?php
session_start();
require '../../required/connection.php';
require '../../required/functions.php';
if (!isset($_SESSION['alive']))
{
$id = $_GET['trxid'];
$_SESSION['alive'] = uniqid();
$currentSession = $_SESSION['alive'];
$checkQuery = "SELECT token FROM request_data WHERE token='$currentSession'";
$checkResult = mysqli_query($con, $checkQuery);
$row = mysqli_num_rows($checkResult);
if($row < 1)
{
$firstQuery = "INSERT INTO request_data (token, link) VALUES ('$currentSession', '$id')";
$firstResult = mysqli_query($con, $firstQuery);
}
}