In this article we will see how to display the name of the user logged in the system, in the header of an application menu.  
This example was created using the Scritpcase native security module**1. First, select the user or login.**

Access an app\_login application, make the security module, in the application settings access the onValidate event.

In this event it is possible to obtain the login used by the client **[usr\_login]**.

1. if(sc\_logged\_is\_blocked()) { sc\_error\_exit(); }
2. $slogin = sc\_sql\_injection({login});
3. $spswd = sc\_sql\_injection(hash("md5",{pswd}));
4. $sql = "SELECT
5. priv\_admin,
6. active,
7. name,
8. email
9. FROM sec\_users
10. WHERE login = $slogin
11. AND pswd = ".$spswd."";
12. sc\_lookup(rs, $sql);
13. if(count({rs}) == 0)
14. {
15. sc\_log\_add('login Fail', {lang\_login\_fail} . {login});
16. sc\_logged\_in\_fail({login});
17. sc\_error\_message({lang\_error\_login});
18. }
19. else if({rs[0][1]} == 'Y')
20. {
21. **$usr\_login =  {login};**
22. $usr\_priv\_admin = ({rs[0][0]} == 'Y') ? TRUE : FALSE;
23. $usr\_name = {rs[0][2]};
24. $usr\_email  = {rs[0][3]};
25. **sc\_set\_global($usr\_login);**
26. sc\_set\_global($usr\_priv\_admin);
27. sc\_set\_global($usr\_name);
28. sc\_set\_global($usr\_email);
29. }
30. else
31. {
32. sc\_error\_message({lang\_error\_not\_active});
33. sc\_error\_exit();
34. }

**2. Then access the menu application. Access the onAplicationInit event and use the code below**

1. $sql = "SELECT name FROM sec\_users WHERE login = '".[]."'";
2. sc\_lookup(ds,$sql);
3. sc\_reset\_global([var\_glob1]);
4. [nome] = {ds[0][0]};

**3. Then go to Layout> Header & Footer and then we will assign the value of the variable [name] to one of the header variables.**

![](https://desk.zoho.com/DocsDisplay?zgId=716875472&mode=inline&blockId=k97k96da6fb8d0423449f8c5cc1a200e7fb0c)

**4. Then, when accessing the login, the user name will be displayed in the menu header.**