Menu

#443 Nicknames Won't Stick

open
nobody
5
2006-07-28
2006-07-28
Anonymous
No

Name: Steve Scanlan
Email: stscanlan@hphs.lausd.k12.ca.us

I am running a high school web site and need to have users nicknames frozen to their actual usernames. I have tried everything I can think of to get this to happen.

I have loaded the chat as an include file to an authentication script which stores a session variable named $_SESSION["username"]
I use this variable to set the name of the nick.
<?php
$username=$_SESSION["username"];
require_once "src/phpfreechat.class.php"; // adjust to your own path
$params["serverid"] = md5(__FILE__);
$params["nick"] = $username; // it can be useful to take nicks from a database
$params["nick"] = iconv("ISO-8859-1", "UTF-8",$params["nick"]);
$params["frozen_nick"] = true;
$chat = new phpFreeChat($params);

The program doesn't acknowledge the nickname I passed it. I have php print out $params["nick"] at the bottom of the web page to ensure that it has been passed.
<?php $chat->printChat();
echo "This is username ".$params['nick'];
?>

If I have forgotten something, please let me know.
Nothing in the examples shows me another option.

Thank You,
Steve Scanlan

Discussion


Log in to post a comment.