I've got a profile page that shows a users current account number in an input field. The user can change this account number and submit the form to update the database with their new account number.
What I need to do is get the initial account number, as well as the new submitted account number so I can use them in another script that runs on the same page.
$user = Am_Di::getInstance()->auth->getUser();
$oldnum = $user->accountnumber;
$newnum = $_GET['accountnumber'];
$client2 = $api->findClient( mlApi::LICENSE_ACCOUNT, $oldnum );
$client = array( 'account_no' => $newnum, 'real_demo' => '1', 'comment' => 'test2' );
$api->updateClient( mlApi::LICENSE_ACCOUNT, $client2[_index], $client );
If you want to keep a value saved for future use there is two common ways (could be other ways) of handling it.
The latter has a 100% security problem because a malicious user can change this id before the next request comes. To demonstrate how
This method use is highly discouraged.
The first method, using the session is the safest mechanism of all.
To utilize that
I hope this answers your question.