wmnitin
Member
Hello, I am creating my own php application. Actually i want to get userid of logged in user. As far as i know first i have to get cookie.
So, here is code that i have placed in /library/mycode/example/index.php
Now i am using it with callback <xen:callback class="Mycode_Example_index" method="getHtml"></xen:callback>
But it is showing not logged on...even i am logged in !
So, here is code that i have placed in /library/mycode/example/index.php
Code:
class Mycode_Example_index
{
public static function getHtml()
{
$nit= (isset($_COOKIE["xf_user"]) ? $_COOKIE["xf_user"] : '');
if ($nit) {
echo "display information for users who are logged on";
}
if (!$nit) {
echo "display information for users who are not logged on";
}
}
}
Now i am using it with callback <xen:callback class="Mycode_Example_index" method="getHtml"></xen:callback>
But it is showing not logged on...even i am logged in !