Unable to use $my variable

14 years 2 months ago #3342 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
14 years 2 months ago #3348 by Phil_K
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.
Moderators: beatnantkrileon
Time to create page: 0.403 seconds

Facebook Twitter LinkedIn