WebSite X5Help Center

 
Lucio Flavio
Lucio Flavio
User

Como indicar o caminho para o nome do usuário logado?  pt

Autor: Lucio Flavio
Visited 2034, Followers 1, Udostępniony 0  

Como inserir o caminho para coletar o nome do usuário logado??

exemplo:

<?php echo $_SESSION['realname'] ?>

Posted on the
1 ODPOWIEDZI - 1 PRAWIDłOWA ODPOWIEDź
Lucio Flavio
Lucio Flavio
User
Autor

Hello Lucio,

I'm not sure that I understand you correctly, but if you seek the correct syntax for the code you quoted then it would be as follows:

<?php echo $_SESSION['realname']; ?>

However, that won't work on its own.  If you want to capture the logged in user within WebSite X5 then you need some extra steps:

Be sure to start the session on the page in question (code in header):

i.e. <?php session_start(); ?>

Followed by this code:

<?php

$pa = new imPrivateArea();

$user = $pa->who_is_logged();

?>

You can then return the name of the logged in user by way of the following code:

<?php echo $user['realname']; ?>

Hope this is what you are looking for...

Kind regards,

Paul

Czytaj więcej
Posted on the from Lucio Flavio