General discussion
Help passing a user session variable

Does anyone have a problem using the session variable username, the #ses = $_SESSION['username']; ? This does not appear to work.

Does anyone have a problem using the session variable username, the #ses = $_SESSION['username']; ? This does not appear to work.

Does anyone have a problem using the session variable username, the #ses = $_SESSION['username']; ? This does not appear to work.

I don't know but do you try a using $ses? In your code i see you are uing #ses... Dollar sign is right way if you are using php... i gonna try when i have a time but if you wana get a current user username you can simply use

$user = User:: get();
echo $user->username;

read more herehttps://codoforum.com/documentation/core-codof-user

>Does anyone have a problem using the session variable username, the #ses = $_SESSION['username']; ? This does not appear to work. I don't know but do you try a using $ses? In your code i see you are uing #ses... Dollar sign is right way if you are using php... i gonna try when i have a time but if you wana get a current user username you can simply use ```` $user = User:: get(); echo $user->username; ```` read more herehttps://codoforum.com/documentation/core-codof-user

Hi I am helping Breez with this on our side. The code looke like this:

<?php
$ses=$_SESSION['username'];
echo($ses);>

I have tried this many different ways including hard coding like:

<?php
$ses='Dan';
echo($ses);>

My echo or print works fine. When I view the source code, the javascript even looks fine:

Dan<script type="text/javascript" language="javascipt" src="http://172.16.16.29/freichat/client/main.php?id=Dan&xhash=1f921bdea723a9795ca33c62f3cd8fbc"></script>
<link rel="stylesheet" href="http://172.16.16.29/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css">

I am completely baffled.

Hi I am helping Breez with this on our side. The code looke like this: &amp;gt; &amp;lt;?php $ses=$_SESSION[&#039;username&#039;]; echo($ses);&amp;gt; I have tried this many different ways including hard coding like: &amp;gt; &amp;lt;?php $ses=&#039;Dan&#039;; echo($ses);&amp;gt; My echo or print works fine. When I view the source code, the javascript even looks fine: &amp;gt; Dan&amp;lt;script type=&quot;text/javascript&quot; language=&quot;javascipt&quot; src=&quot;http://172.16.16.29/freichat/client/main.php?id=Dan&amp;amp;xhash=1f921bdea723a9795ca33c62f3cd8fbc&quot;&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;http://172.16.16.29/freichat/client/jquery/freichat_themes/freichatcss.php&quot; type=&quot;text/css&quot;&amp;gt; I am completely baffled.

It's see, to be fine but rememeber if you are passing session to another page. you need start_session() othervise it's not working. But i belive That CODOFORUM probably trow out header alrerady sent error. But not quit check how it works, but i belive that you can definetly try doing this.

$user = User:: get();
echo $user->username;

Anywhere on your page. Mybe if You tell what realy you wan get out i can write a small code who can help you. I have not checek the FREICHAT, but when i get home to acces my server. I probably check this out. Also I belive that you want that CODOFORUM users can acces the FREICHAT. Am i right?

Sory for my bad ENGLISH

It&#039;s see, to be fine but rememeber if you are passing session to another page. you need start_session() othervise it&#039;s not working. But i belive That CODOFORUM probably trow out header alrerady sent error. But not quit check how it works, but i belive that you can definetly try doing this. ```` $user = User:: get(); echo $user-&amp;gt;username; ```` Anywhere on your page. Mybe if You tell what realy you wan get out i can write a small code who can help you. I have not checek the FREICHAT, but when i get home to acces my server. I probably check this out. Also I belive that you want that CODOFORUM users can acces the FREICHAT. Am i right? Sory for my bad ENGLISH

Hi,

If you are trying to integrate Codoforum with FreiChat , then what @JOJOManLV said is correct.

But, remember that, this code will only work in a plugin.
So you will have to create a plugin in Codoforum.

Hi, If you are trying to integrate Codoforum with FreiChat , then what @JOJOManLV said is correct. But, remember that, this code will only work in a plugin. So you will have to create a plugin in Codoforum.

The code

$user = User:: get();
echo $user->username;

Doesn't work and returns: Fatal error: Class 'User' not found in /var/www/html/template/testchat.php on line 3

I am using this custom, without any other plugins, just as a straight application providing chat.

If I use "login_id" which I have as a session variable, it is not picked up and I am still getting guest user names. Is there something within Freichat that I need to alter to make it use internal PHP session rather than one CODOFORUM creates?

Dan

The code &amp;gt; $user = User:: get(); echo $user-&amp;gt;username; Doesn&#039;t work and returns: Fatal error: Class &#039;User&#039; not found in /var/www/html/template/testchat.php on line 3 I am using this custom, without any other plugins, just as a straight application providing chat. If I use &quot;login_id&quot; which I have as a session variable, it is not picked up and I am still getting guest user names. Is there something within Freichat that I need to alter to make it use internal PHP session rather than one CODOFORUM creates? Dan

As we said previously, you need to create a plugin in codoforum.

Please have a look at the docs and create a dummy plugin in codoforum

After you do that, we will let you know how you should proceed with the integration.

As we said previously, you need to create a plugin in codoforum. Please have a look at the docs and create a dummy plugin in codoforum After you do that, we will let you know how you should proceed with the integration.
723
6
4
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft