Update session variable on file upload
Hi I have created a quite complex file upload page. Users can upload 10 different files all with different buttons.
When a user clicks a specific button the file is uploaded to a database AND a folder. The user table is also set to update to show they user has already updated that file. i.e. User uploads file called medical documentation. ------> file goes to database as .PDF (binary), goes to folder as .PDF, and gets updated for that specific user on the users table as an integer from 0 to 1.
I also have that column in the users table set as a server variable on login. I would like to have that server variable immediately update when the file is uploaded or page refresh. What I dont want is the user to have to logout and login to reset the server variable. My overall goal is to show checkmark on the page after successful file upload, I was trying to do this using security assist acess rules manager and server behavior of ShowRegion by access rules.
I probably made this way more confusing than it had to be, but i have no idea how to code...
I have tried a simple session_start () and that does not work. I should also tell you that I have security assist limit access to specific users on this page according to UserLevel.
I have also tried to update server variable by
<?php
@session_start();
if($_SERVER["REQUEST_METHOD"] == "POST") {
foreach($_POST as $k => $v) {
// store as session
$_SESSION[$k] = $v;
}
}
?>
and then echoing the form, but remember they enter a file to upload... and my server variable is and intenger 0 or 1.
Is there a way to update server variable from recordset or pull the intager directly from database?