Unable to use $my variable

18 years 3 months ago #3342 by lis
Unable to use $my variable was created by lis
Hi, I'm a CB newbie and I'm trying to integrate some php pages into Joomla+CB.

I write a simple php test page:

[code:1]<?php
global $my;
if ($my-id) { echo "this user is logged in <br>"; }
else { echo "this shitface should still log in first <br>"; }
?>
[/code:1]

I put this code into a php file and I linked this php file from a joomla wrapper module, but I see always not logged message, even if I'm logged in (yes, I use CB login module).

Is there any problem using a wrapper module?
All I need is to know if the user is logged in and, if yes, his profile details.
Can someone help me? Thank you

Please Log in to join the conversation.

18 years 3 months ago #3348 by Phil_K
Replied by Phil_K on topic Re:Unable to use $my variable
Hi.

There is a small typo in your code. Try using:

[code:1]
if ($my->id) { echo "this user is logged in <br>"; }
[/code:1]

Greets
Phil.

Please Log in to join the conversation.

18 years 3 months ago #3351 by lis

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.159 seconds

Facebook Twitter LinkedIn