Bug #15148: Troubbles with setcookie (on Unix Solaris php)

From: Date: Mon, 21 Jan 2002 15:31:47 +0000
Subject: Bug #15148: Troubbles with setcookie (on Unix Solaris php)
Groups: php.dev 
Request: Send a blank email to php-dev+get-77693@lists.php.net to get a copy of this message
From: alexis.escobar@micrologus.cl Operating system: Solaris 5.8 PHP version: 4.1.1 PHP Bug Type: *General Issues Bug description: Troubbles with setcookie (on Unix Solaris php) Hi guys... I had a script (sw.php) who works fine on php 4.1.1 on Windows NT, but when I try to run it on Solaris show me the following error: Warning: Cannot add header information - headers already sent by (output started at /www/htdocs/db-include.old:2) in /www/htdocs/sw.php on line 46 sw.php, call via OCI8 an Oracle8 database through db-include.old file who assigns username, password and string connection: <---- sw.php -----> $rut=$HTTP_COOKIE_VARS["rut_alum"]; require('db-include.old'); $Connection = OCILogon(DB_USER,DB_PASS,DB_NAME); $q_semeinsc = "select ..."; $statement1 = ociparse($Connection, $q_semeinsc); ociexecute($statement1, OCI_DEFAULT); while (OCIFetchinto($statement1, &$semeinsc, OCI_ASSOC+OCI_RETURN_NULLS)) { $vanual = $semeinsc[VAR]; ... } if(!isset($nsemestre)) { $server_name = getenv("SERVER_NAME"); $http_host = getenv("HTTP_HOST"); setcookie("nsemestre", $vanual, time()+3600); } <---- End -----> The warning points to the setcookie line. The script fetch the results of Database, but show that ugly warning... Can u help me? I'm very desperated... Greetings Alexis from Chile (sorry for my english) -- Edit bug report at: http://bugs.php.net/?id=15148&edit=1

« previous php.dev (#77693) next »