PDA

View Full Version : fuctions.php


joaorp
11-21-2003, 09:51 PM
Hello everyone,

Could anyone please tell me is possible why I'm getting a error in every page and can't go to admin panel always cause a line on admin/fuctions.php

the part of the line says this

// ###################### Start vbsetcookie #######################
function vbsetcookie($name,$value="",$permanent=1) {
global $cookiepath,$cookiedomain, $SERVER_PORT;

if ($permanent) {
$expire=time() + 60*60*24*365;
} else {
$expire = 0;
}

if ($SERVER_PORT == "443") {
// we're using SSL
$secure = 1;
} else {
$secure = 0;
}

if (defined('USE_COOKIE_WORKAROUND')) {
// It's been reported that there's a bug in PHP 4.2.0/4.2.1 with Apache 2 causing setcookie() to not work correctly.
// This is the workaround. If you need to use this code, please add:
// define('USE_COOKIE_WORKAROUND', 1);
// to your config.php.

if (!$value) {
// need to do this so IE deletes the cookie correctly
$expire = time() - 31536001;
$value = 'deleted';
}
$cookieheader = "Set-Cookie: $name=".urlencode($value);
if ($expire) {
$cookieheader .= '; expires='.gmdate('D, d-M-Y H:i:s', $expire).' GMT';
}
if ($cookiepath) {
$cookieheader .= "; path=$cookiepath";
}
if ($cookiedomain) {
$cookieheader .= "; domain=$cookiedomain";
}
if ($secure) {
$cookieheader .= '; secure';
}
header($cookieheader, false); // force multiple headers of same type
} else {
setcookie($name, $value, $expire, $cookiepath, $cookiedomain, $secure);
}

}
and is the one "setcookie($name, $value, $expire, $cookiepath, $cookiedomain, $secure);"

Thank you in advance :)

EDIT: the error is this
Warning: Cannot modify header information - headers already sent by (output started at /home/joaorp/public_html/testvb/admin/functions.php:2700) in /home/joaorp/public_html/testvb/admin/functions.php on line 1880

Warning: Cannot modify header information - headers already sent by (output started at /home/joaorp/public_html/testvb/admin/functions.php:2700) in /home/joaorp/public_html/testvb/admin/functions.php on line 1880

g-force2k2
11-21-2003, 10:41 PM
What hacks or other files have you modified that could've possibly created this error?

Regards,
g-force2k2

assassingod
11-22-2003, 06:53 AM
Just to note, that error is usually caused by a whitespace after ?>

joaorp
11-22-2003, 07:39 AM
Just to note, that error is usually caused by a whitespace after ?>
Much obliged!!!!!!!
That fixed everything... all I had to look is look for the squares with notepad after the ?> on fuctions.php and adminfuctions.php

One more question.. is there by any chance a program like notepad (super simple program) which edit the files like I do with cpanel? since the notepad read everything diferent formated, If i open with word it will change me the formation of the file :(

Thank you again in advance.
Regards

assassingod
11-22-2003, 07:45 AM
Much obliged!!!!!!!
That fixed everything... all I had to look is look for the squares with notepad after the ?> on fuctions.php and adminfuctions.php

One more question.. is there by any chance a program like notepad (super simple program) which edit the files like I do with cpanel? since the notepad read everything diferent formated, If i open with word it will change me the formation of the file :(

Thank you again in advance.
Regards
Take a look at TextPad:)

joaorp
11-22-2003, 08:38 AM
Take a look at TextPad:)
hehe, silly me, I tryed wordpad, if thats what you mean, and it works fine, Thank you again. :)