I'm trying to achieve something that I canโt plunge into. The fact is that when a specific user is registered, I store in a user session and record it.
Before telling me โyesโ, I know that this is not the best practice, but the purpose of this page is only internal, and there is no way to be hacked, or because you can access it only internally.
In any case, the fact is that there are some editable fields in the table that should be edited only by the administrator, but this should only be visible to the rest.
To achieve an editable table, I used the datatables library along with some ajax and jQuery.
I cannot come up with a method to restrict editing if the registered user is not an administrator, except:
var logged = <?php echo $_SESSION['logged_user'];?>; if (logged=='admin') {
Do you know the best method or is it easier to understand? Thank you very much!
source share