Hi
setCookie has that error msg and here is the code:
if (isset($_COOKIE['last_currency_id'])) //if 'last_currency_id' was set in cookie, I want to get the data from DB.
{
$currency_id = $_COOKIE['last_currency_id'];
list($currency_symbol, $exchange_rate) = getCurrencyInfo($currency_id);
//it returns the following data:
echo $currency_id;
echo $currency_symbol;
echo $exchange_rate;
}
else //if no cookie was set, then search the default currency from DB and set them in cookie
{
$data = getDefaultCurrency();
list($currency_id, $currency_symbol, $exchange_rate) = $data;
setcookie("last_currency_id", $currency_id, $year10);
setcookie("last_currency_symbol", $currency_symbol, $year10);
setcookie("last_currency_exchange_rate", $exchange_rate, $year10);
}
However, it showed the error "Warning: Cannot modify header information - headers already sent by "
How can I solve it?