FreiChat related discussions
Custom Drivers Problems

Hi All!
I'm a new user :)

I was trying FreiChatX on local but it doesn't work..
I just installed it by following the procedure and then changing args vars:

$ses_username='userid'; /* Username stored in session*/ //Only index value
$ses_userid='userid'; /* Userid stored in session */ //Only index value

Note that $_SESSION['userid'] is is the id of each logged user.

I also included into the head tags:

<script type="text/javascript" language="javascipt" src="http://localhost/jb/site/site2/profiles/facechat/freichat/client/main.php?id=0"></script><link rel="stylesheet" href="http://localhost/jb/site/site2/profiles/facechat/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css">


and





into the body tags.

Now i can see the chat windows on the bottom right corner of the page but it's always empty (no users).


I hope you'll help me
Thanks

Neb
Hi All! I&#039;m a new user :) I was trying FreiChatX on local but it doesn&#039;t work.. I just installed it by following the procedure and then changing args vars: $ses_username=&#039;userid&#039;; /* Username stored in session*/ //Only index value $ses_userid=&#039;userid&#039;; /* Userid stored in session */ //Only index value Note that $_SESSION[&#039;userid&#039;] is is the id of each logged user. I also included into the head tags: &amp;lt;script type=&quot;text/javascript&quot; language=&quot;javascipt&quot; src=&quot;http://localhost/jb/site/site2/profiles/facechat/freichat/client/main.php?id=0&quot;&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;http://localhost/jb/site/site2/profiles/facechat/freichat/client/jquery/freichat_themes/freichatcss.php&quot; type=&quot;text/css&quot;&amp;gt; and &amp;lt;div class=&quot;freichathtml&quot; id=&quot;freichathtml&quot;&amp;gt; &amp;lt;/div&amp;gt; into the body tags. Now i can see the chat windows on the bottom right corner of the page but it&#039;s always empty (no users). I hope you&#039;ll help me Thanks Neb

There are two ways of integrating FreiChatX

1. Psession
2. Sdatabase

I think you used Psession.

So first quest what is the value of the variable $freiuse , it must be "Psession"

Next ,

$ses_username='userid'; /* Username stored in session*/ //Only index value
$ses_userid='userid'; /* Userid stored in session */ //Only index value


The variable $ses_userid looks ok but $ses_username isn't .

Note that $_SESSION['userid'] is is the id of each logged user.


And where do you store the usernames , if id is stored is $_SESSION['userid']?

Also what did you add in head and body tags ?

There are two ways of integrating FreiChatX 1. Psession 2. Sdatabase I think you used Psession. So first quest what is the value of the variable $freiuse , it must be &quot;Psession&quot; Next , &amp;lt;code&amp;gt;$ses_username=&#039;userid&#039;; /* Username stored in session*/ //Only index value $ses_userid=&#039;userid&#039;; /* Userid stored in session */ //Only index value&amp;lt;/code&amp;gt; The variable $ses_userid looks ok but $ses_username isn&#039;t . &amp;lt;em&amp;gt;Note that $_SESSION[&#039;userid&#039;] is is the id of each logged user. &amp;lt;/em&amp;gt; And where do you store the usernames , if id is stored is $_SESSION[&#039;userid&#039;]? Also what did you add in head and body tags ?
Necessity is the mother of all inventions!

Hi!
First of all Thanks for your response :)

So..

I added

<script type="text/javascript" language="javascipt" src="http://localhost/jb/site/site2/profiles/facechat/freichat/client/main.php?id=0"></script><link rel="stylesheet" href="http://localhost/jb/site/site2/profiles/facechat/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css">

into head tags

and
<div class="freichathtml" id="freichathtml"> </div>

into body tags!

Morover:
$freiuse="Psession"; //can have value as Psession or Sdatabase


and
$default_ses=null; //If you dont make any checks leave it null

$ses_username='name'; /* Username stored in session*/ //Only index value
$ses_userid='userid'; /* Userid stored in session */ //Only index value

(have just changed username)

Values are ok, I checked them by printg into the same page
echo $_SESSION['userid'] . " " . $_SESSION['name']; ?>


But the chat is still empty of users

Thanks,
Neb

Hi! First of all Thanks for your response :) So.. I added &amp;lt;code&amp;gt; &amp;lt;script type=&quot;text/javascript&quot; language=&quot;javascipt&quot; src=&quot;http://localhost/jb/site/site2/profiles/facechat/freichat/client/main.php?id=0&quot;&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;http://localhost/jb/site/site2/profiles/facechat/freichat/client/jquery/freichat_themes/freichatcss.php&quot; type=&quot;text/css&quot;&amp;gt; &amp;lt;/code&amp;gt; into head tags and &amp;lt;code&amp;gt; &amp;lt;div class=&quot;freichathtml&quot; id=&quot;freichathtml&quot;&amp;gt; &amp;lt;/div&amp;gt; &amp;lt;/code&amp;gt; into body tags! Morover: &amp;lt;code&amp;gt; $freiuse=&quot;Psession&quot;; //can have value as Psession or Sdatabase &amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt; $default_ses=null; //If you dont make any checks leave it null $ses_username=&#039;name&#039;; /* Username stored in session*/ //Only index value $ses_userid=&#039;userid&#039;; /* Userid stored in session */ //Only index value &amp;lt;/code&amp;gt; (have just changed username) Values are ok, I checked them by printg into the same page &amp;lt;code&amp;gt; &amp;lt;? echo $_SESSION[&#039;userid&#039;] . &quot; &quot; . $_SESSION[&#039;name&#039;]; ?&amp;gt; &amp;lt;/code&amp;gt; But the chat is still empty of users Thanks, Neb

Looks like everything is correct ,

Now , i think some debugging should help.

In FreiChatX backend , enable PHP debugging and JS debugging .

There will be a freix.log file created in ~freichat directory now.
Post the output in that file here.

Also , if you have chrome or firefox(firebug) check if the request are sent succesfully
also check their response.

Looks like everything is correct , Now , i think some debugging should help. In FreiChatX backend , enable PHP debugging and JS debugging . There will be a freix.log file created in ~freichat directory now. Post the output in that file here. Also , if you have chrome or firefox(firebug) check if the request are sent succesfully also check their response.
Necessity is the mother of all inventions!

Here is freixlog.log

May 6, 2011, 8:08 pm: connected to database successfully
May 6, 2011, 8:08 pm: connected to database successfully
May 6, 2011, 8:08 pm: connected to database successfully
May 6, 2011, 8:08 pm: connected to database successfully
May 6, 2011, 8:08 pm: connected to database successfully
May 6, 2011, 8:08 pm: connected to database successfully
May 6, 2011, 8:08 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: main.php loaded
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: main.php loaded
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:09 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: main.php loaded
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: main.php loaded
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: main.php loaded
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully
May 6, 2011, 8:10 pm: connected to database successfully

I logged with two different users in two different browsers, chrome and firefox.

Here is freixlog.log &amp;lt;code&amp;gt; May 6, 2011, 8:08 pm: connected to database successfully May 6, 2011, 8:08 pm: connected to database successfully May 6, 2011, 8:08 pm: connected to database successfully May 6, 2011, 8:08 pm: connected to database successfully May 6, 2011, 8:08 pm: connected to database successfully May 6, 2011, 8:08 pm: connected to database successfully May 6, 2011, 8:08 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: main.php loaded May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: main.php loaded May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:09 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: main.php loaded May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: main.php loaded May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: main.php loaded May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully May 6, 2011, 8:10 pm: connected to database successfully &amp;lt;/code&amp;gt; I logged with two different users in two different browsers, chrome and firefox.

The only thing left to check is now the response of the request.

If you use chrome you can chessck the response of the freichat requests
in the network tab.

The only thing left to check is now the response of the request. If you use chrome you can chessck the response of the freichat requests in the network tab.
Necessity is the mother of all inventions!

I'm sorry but I don't know how to do it,
so can you explain me please?
(What is chrome network tab?)

I&#039;m sorry but I don&#039;t know how to do it, so can you explain me please? (What is chrome network tab?)

In chrome browser ,

Rightclick on mouse to inspect element.

When you click on inspect element a debugging window will open.

There will a tab named Network , click that .

The scroll down , you will see that there are requests being made every 5 seconds
by freichat , click anyone of them , then you will see the headers of the request .
Now here, ther will be a tab named response/content click it to see the resonse of that
particular request.

And then post the response here.

Before doing anything , i just want to recommend one change in ~/freichat/server/freichat.php

In that file in the first 4 lines comment the line

error_reporting(-1);


i.e it should look like this
//error_reporting(-1);

In chrome browser , Rightclick on mouse to inspect element. When you click on inspect element a debugging window will open. There will a tab named Network , click that . The scroll down , you will see that there are requests being made every 5 seconds by freichat , click anyone of them , then you will see the headers of the request . Now here, ther will be a tab named response/content click it to see the resonse of that particular request. And then post the response here. Before doing anything , i just want to recommend one change in ~/freichat/server/freichat.php In that file in the first 4 lines comment the line &amp;lt;code&amp;gt;error_reporting(-1);&amp;lt;/code&amp;gt; i.e it should look like this &amp;lt;code&amp;gt;//error_reporting(-1);&amp;lt;/code&amp;gt;
Necessity is the mother of all inventions!

in ~/freichat/server/freichat.php there are no lines with error reporting functions:

<?php session_start();
require("../define.php");

class freichat extends freichatXconstruct
{
public $userdata;
public $messages=array();

public function __construct()
{
parent::__construct();
require_once RDIR.'/server/drivers/'.$this->driver.'.php';


Anyway here is the content tab:

Strict Standards: Creating default object from empty value in /var/www/jb/site/site2/profiles/facechat/freichat/server/freichat.php on line 145
{"user_array":["lala_1"],"id_array":["1"],"islog":"userloggedin","status":1,"messages":[],"userdata":"<span onmousedown="\"FreiChat.createChatBoxmesg('lala_1','1')\""><a class='\"online-usr-list\"' href="javascript:void(0)"><span style="display:block"><img src="http:%5C/%5C/localhost%5C/jb%5C/site%5C/site2%5C/profiles%5C/facechat%5C/freichat%5C/%5C/client%5C/jquery%5C/user.jpeg" height="22" width="22" alt="avatar" align="left">&nbsp;<img style="padding:4px;" src="http:%5C/%5C/localhost%5C/jb%5C/site%5C/site2%5C/profiles%5C/facechat%5C/freichat%5C/client%5C/jquery%5C/freichat_themes%5C/ce_green%5C/online.png" height="12" width="12" alt="status" align="right">lala_1<hr style="margin-top:5px;margin-bottom:5px;color:black">","count":1,"username":"lala_3","userid":"3"}
</span></a></span>

in ~/freichat/server/freichat.php there are no lines with error reporting functions: &amp;lt;code&amp;gt; &amp;lt;?php session_start(); require(&quot;../define.php&quot;); class freichat extends freichatXconstruct { public $userdata; public $messages=array(); public function __construct() { parent::__construct(); require_once RDIR.&#039;/server/drivers/&#039;.$this-&amp;gt;driver.&#039;.php&#039;; &amp;lt;/code&amp;gt; Anyway here is the content tab: &amp;lt;code&amp;gt; Strict Standards: Creating default object from empty value in /var/www/jb/site/site2/profiles/facechat/freichat/server/freichat.php on line 145 {&quot;user_array&quot;:[&quot;lala_1&quot;],&quot;id_array&quot;:[&quot;1&quot;],&quot;islog&quot;:&quot;userloggedin&quot;,&quot;status&quot;:1,&quot;messages&quot;:[],&quot;userdata&quot;:&quot;&amp;lt;span onmousedown=\&quot;FreiChat.createChatBoxmesg(&#039;lala_1&#039;,&#039;1&#039;)\&quot;&amp;gt;&amp;lt;a class=\&quot;online-usr-list\&quot; href=&#039;javascript:void(0)&#039;&amp;gt;&amp;lt;span style=&#039;display:block&#039;&amp;gt;&amp;lt;img src=&#039;http:\/\/localhost\/jb\/site\/site2\/profiles\/facechat\/freichat\/\/client\/jquery\/user.jpeg&#039; height=&#039;22&#039; width=&#039;22&#039; alt=&#039;avatar&#039; align=&#039;left&#039;\/&amp;gt;&amp;lt;\/span&amp;gt;&amp;nbsp;&amp;lt;img style=&#039;padding:4px;&#039;src=&#039;http:\/\/localhost\/jb\/site\/site2\/profiles\/facechat\/freichat\/client\/jquery\/freichat_themes\/ce_green\/online.png&#039; height=&#039;12&#039; width=&#039;12&#039; alt=&#039;status&#039; align=&#039;right&#039;\/&amp;gt;lala_1&amp;lt;\/a&amp;gt;&amp;lt;\/span&amp;gt;&amp;lt;hr style=&#039;margin-top:5px;margin-bottom:5px;color:black&#039;\/&amp;gt;&quot;,&quot;count&quot;:1,&quot;username&quot;:&quot;lala_3&quot;,&quot;userid&quot;:&quot;3&quot;} &amp;lt;/code&amp;gt;

Can you see the first line of the content ,
there's a error.

Since its a strict standard error , it wont affect freichat so we can
suppress it for now to avoid changes in code.

To do that just add the below line after the starting <?php tag
in the file i.e ~/freichat/server/freichat.php

<code>
error_reporting(0);


Also do you remember i had told you to comment three lines of code in my last
post , now adding this line will have the same effect and will meet the same purpose.

Can you see the first line of the content , there&#039;s a error. Since its a strict standard error , it wont affect freichat so we can suppress it for now to avoid changes in code. To do that just add the below line after the starting &amp;lt;?php tag in the file i.e ~/freichat/server/freichat.php &amp;lt;code&amp;gt; error_reporting(0); &amp;lt;/code&amp;gt; Also do you remember i had told you to comment three lines of code in my last post , now adding this line will have the same effect and will meet the same purpose.
Necessity is the mother of all inventions!

I added the line into the file

<?php session_start();
error_reporting(0);
require("../define.php");

class freichat extends freichatXconstruct
[. . .]

I added the line into the file &amp;lt;code&amp;gt; &amp;lt;?php session_start(); error_reporting(0); require(&quot;../define.php&quot;); class freichat extends freichatXconstruct [. . .] &amp;lt;/code&amp;gt; And now the chat works :)

I am also having an error on custom driver. But it's another issue. I did all the revisions that i have read here.
But the error now is "invalid install uid".

Could you please point me what this error is about? And can you please explain the code below.

if (md5($id . $uid) != $xhash) {
$_SESSION[$uid . 'usr_ses_id'] = 0;
echo 'invalid install uid';
$_GET['id'] = 0;
$_GET['first'] = 'false';
exit;


Thank you in advance.

I am also having an error on custom driver. But it&#039;s another issue. I did all the revisions that i have read here. But the error now is &quot;invalid install uid&quot;. Could you please point me what this error is about? And can you please explain the code below. &amp;lt;code&amp;gt;if (md5($id . $uid) != $xhash) { $_SESSION[$uid . &#039;usr_ses_id&#039;] = 0; echo &#039;invalid install uid&#039;; $_GET[&#039;id&#039;] = 0; $_GET[&#039;first&#039;] = &#039;false&#039;; exit; &amp;lt;/code&amp;gt; Thank you in advance.

Here is my freixlog.txt.

July 13, 2011, 8:54 am: main.php  loaded

July 13, 2011, 8:54 am: connected to database successfully

July 13, 2011, 8:54 am: Inserted the user with the following data :: Username = ednaonia And ID = 0b63bd801eeb361853a1b17778fbdb83 Default status = I am available



And here is my content tab

invalid install uid

Here is my freixlog.txt. &amp;lt;code&amp;gt; July 13, 2011, 8:54 am: main.php loaded July 13, 2011, 8:54 am: connected to database successfully July 13, 2011, 8:54 am: Inserted the user with the following data :: Username = ednaonia And ID = 0b63bd801eeb361853a1b17778fbdb83 Default status = I am available &amp;lt;/code&amp;gt; And here is my content tab &amp;lt;code&amp;gt; invalid install uid &amp;lt;/code&amp;gt;

I guess the error is caused because the hash doesn't match.
The hash generated by the client is matched against the hash generated by the server, This is a security measure to ensure that session doesn't get stolen.

try replacing != by == from the code that you mentioned.
But that is not the solution,
Are you using any software that is not supported by FreiChatX, If you can give me access to your code, i could help, this way it will be an opportunity for me to upgrade the driver.

I guess the error is caused because the hash doesn&#039;t match. The hash generated by the client is matched against the hash generated by the server, This is a security measure to ensure that session doesn&#039;t get stolen. try replacing != by == from the code that you mentioned. But that is not the solution, Are you using any software that is not supported by FreiChatX, If you can give me access to your code, i could help, this way it will be an opportunity for me to upgrade the driver.
Necessity is the mother of all inventions!
96
13
0
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