I have token system where every time you submit the form it take -1 from your total tokens.
I'm using common.php
$ses_sql="Select * from users where name='testuser' and id='1'";
$result = $conn->query($ses_sql);
$row = $result->fetch_assoc();
$token = $row['tokens'];
So beside the menu bar it views your total Credit so you can see it, no matter which page you are in.
Now come the form part. Page name adduser.php
<?
// Included on all pages.
include 'include/common.php';
echo $token;
?>
<form method="post" action="adduser.php?save=all">
<input type="text" name="username">
</form>
<?
$kalk = $token - 1;
if (isset($_GET['save']) && $_GET['save'] == 'all'{
$sqllog = "UPDATE `reseller` set `tokens`='$kalk' where id='1'";
$check1 = mysqli_query($conn,$sqllog);
}
?>
So all this working, perfect. BUT remember the callout on top of the page $token this is not refreshing after the submit, but going into other page OR refreshing the browser the value gets updated. Help is appreciated.