Im using objects in PHP for the first time and have a question about
the following script.
$new_grad = new graduate();
$new_grad->set_fn($_SESSION['first_name']);
$new_grad->set_sn($_SESSION['surname']);
$new_grad->set_username($_SESSION['username']);
$new_grad->set_password($_SESSION['password']);
//etc
The sript is used to set up user accounts when they sign up for my
system.
HOWEVER I am concerned about the following scenario. Say if two or
more users are setting up accounts at roughly the same time.
The first person presses 'submit' so
$new_grad = new graduate();
gets executed.
But if a second or so later another person presses submit the same
line of code will get executed so we will either have two objects with
the same name or the second object will replace the first.
Neither of which is desirable so how could I avoid this?