I have form to add employess to database. I have to count how many employess were added during one session and display it somewhere on the screen.
Right now my form_validation.php looks like this:
<?php
session_start();
if(formValidationIsCorrect){
$_SESSION['counter']++;
header("location:pageWithFormDetails.php);
}
in pageWithFormDetails.php
I have to display employee information from form (name, age, etc.), and how many employess were added during this session.
My problem is, that when on pageWithFormDetails.php
I do
<?php echo $_SESSION['counter']; ?>
it always displays 1, even If i refill form few times. I guess everytime I complete form, my counter
variable is reset, and then incremented by 1. Is there a way not to reset this variable every time I complete form, and validate it?