Log in

View Full Version : Unable to add cookies, header already sent. NEED HELP


DieselMinded
09-07-2008, 02:37 PM
Unable to add cookies, header already sent.
File: /home/dieselminded/dieselbombers.com/html/profile.php
Line: 332

What do i do to fix this

--------------- Added 1220804662 at 1220804662 ---------------

I think i found the problem ,

Texas Holdem Poker

My Old Profile.php Excerpt

// everything is good - send the singly-hashed MD5 to the password update routine
$userdata->set('password', $vbulletin->GPC['newpassword']);
// Notify PlugInPoker Server of Password Change
$fp = fopen("http://www.pluginpoker.com/popup/changepassword.asp?c=1202&phpu=" . $vbulletin->userinfo['username'] . "&oldp=" . $vbulletin->GPC['currentpassword_md5'] . "&newp=" . $vbulletin->GPC['newpassword_md5'], "r");
if (!$fp) {
echo "ERROR: $errno - $errstr\n";
} else {
fclose($fp);
}
// Update cookie if we have one
$vbulletin->input->clean_array_gpc('c', array(
COOKIE_PREFIX . 'password' => TYPE_STR,
COOKIE_PREFIX . 'userid' => TYPE_UINT)
);

I over wrote it with the newest version profile.php

// everything is good - send the singly-hashed MD5 to the password update routine
$userdata->set('password', $vbulletin->GPC['newpassword']);

// Update cookie if we have one
$vbulletin->input->clean_array_gpc('c', array(
COOKIE_PREFIX . 'password' => TYPE_STR,
COOKIE_PREFIX . 'userid' => TYPE_UINT)
);

The Code added was to also change the password in Plug In poker when a user changed there password in Vbulletin ,

Do you think i have fixed this issue ?

UaECasher
09-07-2008, 03:27 PM
This error happen when you don't write the set cookie command at the start of the file you have to write it 1st thing nothing before it including white space. If this happen after installing a mod ask the creator to fix it

DieselMinded
09-07-2008, 03:37 PM
iu think i may of fixed it by removing the .php edits

Opserty
09-07-2008, 04:16 PM
The problem is the this line:

echo "ERROR: $errno - $errstr\n";

You can't echo in vBulletin. You should add errors to a variable then display them in a template.

p.s. Use PHP tags when posting PHP in future.

DieselMinded
09-07-2008, 06:00 PM
so there code is wrong (Pluginpokers)

Opserty
09-07-2008, 07:14 PM
Well it isn't default vBulletin code... ;)