• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

 being written to the top of my page with mysql container

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
8 posts • Page 1 of 1

Postby agamemnus » Thu Aug 14, 2008 7:12 pm

I have no idea how to fix this. I've tried everything. I tried changing everything all the files to ANSI from UTF-8.... tried reinstalling. Nothing works. The "" just writes itself to the top (with or without javascript, so not a js issue), and I cannot find this string anywhere.

In Firefox 2, it appears but in IE6 it does not.

I have a header also:
header("Content-Type: text/html; charset=ISO-8859-1");

If this line above exists (in either browser) then I will get a header-already-written warning, like:

"Warning: Cannot modify header information - headers already sent by (output started at /home/fsoft/public_html/[]/custom/phpfreechat/src/containers/mysql.class.php:1) in /home/fsoft/public_html/[]/header_opacity.php on line 85"

HELP!
Last edited by agamemnus on Sat Aug 16, 2008 6:39 pm, edited 1 time in total.
agamemnus
Member
 
Posts: 10
Joined: Mon Aug 11, 2008 9:12 pm
Top

Postby OldWolf » Sat Aug 16, 2008 6:01 am

Are you using the chat alone, or trying to use it with something? Have you been able to get an example working?
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby agamemnus » Sat Aug 16, 2008 7:18 pm

I've made a test page: it uses a database and the header function I pasted in earlier. Same problem. My header function definitely conflicts with phpfreechat's own header function, which I have yet to find. I think if I can delete or disable that, the visual glitch will go away too.

I know it's a different character set than what I set it to (ISO-8859-1) because my copyright (c) symbol doesn't show up correctly. Yes, I did try $params['output_encoding'] = 'ISO-8859-1' and also $params['output_encoding'] = '': nothing.

I think all you'd need to do to see this problem is to add this:
header("Content-Type: text/html; charset=ISO-8859-1");
...after '$chat = new phpFreeChat($params)'.
Last edited by agamemnus on Sat Aug 16, 2008 7:18 pm, edited 1 time in total.
agamemnus
Member
 
Posts: 10
Joined: Mon Aug 11, 2008 9:12 pm
Top

Postby OldWolf » Sun Aug 17, 2008 8:19 am

First, did you try rehashing after the parameter changes?

Second, put all the top stuff (parameters and what not) of phpfreechat into the header before anything else prints, then put the print line where you really want it to go. You should be able to post other headers after the php headers.
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby agamemnus » Sun Aug 17, 2008 5:18 pm

>First, did you try rehashing after the parameter changes?

Since I don't know how to do that, I totally delete everything first and re-upload it again. That is what I did, so I am sure all the parameters are as they are. (output encoding as '' right now)
Can you tell me how to "rehash" properly?


>Second, put all the top stuff (parameters and what not) of phpfreechat into the header before anything else prints, then put the print line where you really want it to go. You should be able to post other headers after the php headers.

All the phpfreechat parameters are before the printChat() line and before the 'new phpFreeChat($params)' line. My php header command is after all of this.... if it is placed before, it's simply overridden by phpfreechat and there are no weird characters anywhere, but the character set is still not what I wanted to set it to...

Do you know where the headers are set in phpfreechat?
Last edited by agamemnus on Sun Aug 17, 2008 9:52 pm, edited 1 time in total.
agamemnus
Member
 
Posts: 10
Joined: Mon Aug 11, 2008 9:12 pm
Top

Postby OldWolf » Sun Aug 17, 2008 7:09 pm

http://www.phpfreechat.net/rehash

For the second point, I think you may have misunderstood what I was saying. For a default installation, you would move all of the following to before your own headers and before anything else is printed:

Code: Select all
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Quick chat";
$params["nick"] = "guest".rand(1,1000);  // setup the intitial nickname
$params["isadmin"] = true; // do not use it on production servers ;)
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
//$params["debug"] = true;
$chat = new phpFreeChat( $params );

Now of course, you'll want to use your own custom parameters in place of those and what not, but that's the portion of code that needs to be the very first thing.

After that, place your personal headers, your html, ect. When you hit the point in the page where you'd like the chat to print, use this:
Code: Select all
<?php $chat->printChat(); ?>

Then continue on with your page and your footers.

Does that make sense? The system is designed to be seperate so that you can send other headers without messing up the phpfreechat headers. :)
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby agamemnus » Sun Aug 17, 2008 9:55 pm

Yes, that's what I'm doing. However, as I said, if I add header("Content-Type: text/html; charset=ISO-8859-1"); after $chat = new phpFreeChat( $params ), (and in fact after '$contentdiv[] = $chat->printChat(true);', then I get a php warning about conflicting headers, besides the unsightly . So, I wanted to know where phpfreechat sets the header so I can remove that bit.
Last edited by agamemnus on Sun Aug 17, 2008 9:55 pm, edited 1 time in total.
agamemnus
Member
 
Posts: 10
Joined: Mon Aug 11, 2008 9:12 pm
Top

Postby OldWolf » Sun Aug 17, 2008 10:17 pm

I'm not sure why you'd want to remove it when you can set it in the parameters. Unfortunately I don't know where it's printed. You'll have to do some searching of your own.
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top


Post a reply
8 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 15 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub