DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • April 23, 2018, 11:55:10 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: error msg help?  (Read 3953 times)
0 Members and 1 Guest are viewing this topic.
umk
Member
Militia
**
Offline Offline

Posts: 97


PHP Student


View Profile WWW
« on: November 20, 2005, 11:21:28 PM »

some errors i'm getting

Quote
[Mon Nov 21 01:16:32 2005] [error] PHP Warning:  Cannot modify header information - headers already sent by (output started at /**/***/public_html/lotgd/images/logdnet.php:53) in /**/***/public_html/lotgd/images/logdnet.php on line 68
[Mon Nov 21 01:16:32 2005] [error] PHP Warning:  Cannot modify header information - headers already sent by (output started at /**/***/public_html/lotgd/images/logdnet.php:53) in /**/***/public_html/lotgd/images/logdnet.php on line 67

i get alot of those when i check my error logs in cpanel. can someone tell me how to fix this?


*EDIT*
i forgot to mention that i believe this only happens when logged in to the game, because when i am loggin in to the game, the paypal link (image) for the author disappears, and when i'm not logged in, the image shows correctly.
« Last Edit: November 21, 2005, 12:36:30 AM by umk » Logged

Selekta
Guest
« Reply #1 on: December 07, 2005, 01:23:39 PM »

Here's one possible solution:

*******************************************************************************
Fix details:

The bug was found in file /images/logdnet.php

Cause 1:
Nothing must be sent before headers. The coding allowed for two echo commands to execute before the headings were sent. This resulted in the image being sent without headers, thus the browsers could not correctly interpret it as an image.

This was corrected as follows:

Code:
53-      echo $_SESSION['logdnet']['note']."\n";
54-      echo "// At {$_SESSION['logdnet']['when']}\n";
69+      echo $_SESSION['logdnet']['note']."\n";
70+      echo "// At {$_SESSION['logdnet']['when']}\n";

Cause 2:
The code assumes that the server has variable $_SESSION['user'] set. No code in the game explicitly sets the variable user as global; therefore, isset($_SESSION['user'] is always false and the code proceeds to the wrong branch.

This was corrected as follows:

Code:
57-      if (isset($_SESSION['session']) && isset($_SESSION['user'])) {
57+      if (isset($_SESSION['session']) && isset($_SESSION['session']['user'])) {

*******************************************************************************
Logged
MyLotGD
Captain of the Guard
***
Offline Offline

Posts: 136


View Profile WWW
« Reply #2 on: December 07, 2005, 02:37:03 PM »

You were almost correct.

The problem does actually deal with the headers but it's simply because the script is trying to modify the header information (As the error states). After the headers have already been sent to the clients browser.

To resolve this error enable output buffering at the beginning of the script.

ob_start();
Logged

White Knight
Mod God
*****
Offline Offline

Posts: 1030

For the truth!


View Profile
« Reply #3 on: December 07, 2005, 07:54:43 PM »

The output buffering may create a problem under some circumstances. Here's what I get with output buffering enabled and nothing else changed (local copy of LoGD is running and I am logged in):
Quote
The image http://localhost/lotgd-1.0.5/images/logdnet.php? op=register&c=1&l=en&v=1.0.5&a=http%3A%2F%2Flocalhost%2Flotgd-1.0.5 %2F&d=Another%20LoGD%20Server&e=postmaster%40localhost.com &u=http%3A%2F%2Flogdnet.logd.com%2F cannot be displayed, because it contains errors. (Spaces inserted to preserve forum's table layout.)
The code above may be slower or faster than with buffering, depending on server configuration.
« Last Edit: December 07, 2005, 07:58:18 PM by White Knight » Logged

Helping you help yourself.
kaiser
Member
Captain of the Guard
***
Offline Offline

Posts: 104


I'm such a n00b


View Profile WWW
« Reply #4 on: December 28, 2005, 11:51:36 AM »

ever since adding the obstart I'm getting YOM's from people that they get a page full of gibberish at random times.
Logged

ComfortablyDumb Relaunch
Fast days, lots of turns
http://comfortablydumb.net/logd
kaiser
Member
Captain of the Guard
***
Offline Offline

Posts: 104


I'm such a n00b


View Profile WWW
« Reply #5 on: December 29, 2005, 07:50:08 AM »

Update: The gibberish bug happens at random times, but affects people using IE 6 and not FF. The gibberish people are seeing looks like this:

 ѡ?s ED%?"=,~dB%'rr?D#l`{j FpLJԈ G(Ȗc2Ap?ѳ&zPJ̴Dfh/z@p|z $rXjT3It]?X VI|u^E&\6 o\*׺xmV/V`EWXmk]ؼծ޸#WJZ֯U-JǾu?]XC׽IE(w>?lgKZ Jxn/ pK\ފQ kBr6?.tJ׺ ;

People hit refresh and it goes away, but at this point people are really complaining.  Also ever since adding "ob_start();" people are complaining about slower server response times.

Is there a better way to do this? If I put it back to normal, then my account will be suspended again because of the massive error logs.  If I leave it, I risk losing players dues to screen garbage and slow gameplay.  

Everything was fine until just recently. Has anything changed on lotgdnet that would cause all this nonsense?
Logged

ComfortablyDumb Relaunch
Fast days, lots of turns
http://comfortablydumb.net/logd
kaiser
Member
Captain of the Guard
***
Offline Offline

Posts: 104


I'm such a n00b


View Profile WWW
« Reply #6 on: December 30, 2005, 07:38:55 AM »

ok I've added "ob_end_flush();" at the end of the page (above the <? ) and so far things are looking better.
Logged

ComfortablyDumb Relaunch
Fast days, lots of turns
http://comfortablydumb.net/logd
kaiser
Member
Captain of the Guard
***
Offline Offline

Posts: 104


I'm such a n00b


View Profile WWW
« Reply #7 on: January 03, 2006, 06:29:24 AM »

Skip that...gibberish continues for IE users Sad

Can we get some input on this? How is everyone else dealing with this?
Logged

ComfortablyDumb Relaunch
Fast days, lots of turns
http://comfortablydumb.net/logd
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Please take the time to read the FAQ and browse the DragonPedia

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
19 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search