I am working on a website where I need to write data to a request file, the latter on read data from a response file, then based on the content set variables that can be sent to other pages on the site. I would prefer to use cookies for convenience, however, I would entertain any viable solution.

I tried the following:

$fd = fopen($request);
fwrite($fd,$requestString);

$fd = fopen($response);
$buf = fgets($fd,1024);
fclose($fd);

$params = GetParameters($buf);

if ($params['ACCESS']) {
 setcookie('SECRET',$param['SECRET']);
}
else {
 setcookie('ERROR',$param['ERROR']);
}

header($uri);

and got:*

Warning*: Cannot modify header information - headers already sent by (output started at /<path>/site_functions.php:26))
which corresponds to the first fopen statement used to write a file.

Steve.


/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to