Hi,
I have one index.php file that adds and gets data from a mysql database.
Within this file i have an include statement:
include("include/mcrypt-functions.php");
where "mcrypt-functions.php" is the following:
<?php
function funct_encrypt($data)
{
$key = "fuvBUcutvIVbiuvuv";
$iv_size = mcrypt_get_iv_size(MCRYPT_XTEA, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$enc = mcrypt_encrypt(MCRYPT_XTEA, $key, $data, MCRYPT_MODE_ECB, $iv);
return $encrypted;
}
function funct_decrypt($data)
{
$key = "fuvBUcutvIVbiuvuv";
$iv_size = mcrypt_get_iv_size(MCRYPT_XTEA, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$dec = mcrypt_decrypt(MCRYPT_XTEA, $key, $data, MCRYPT_MODE_ECB, $iv);
return $decrypted;
}
?>
after i add or get data from the database i redirect back to the main page using:
header('Location: index.php?p=viewall');
but when i do this i get a message like this:
Warning: Cannot modify header information - headers already sent by (output started at /home/*****/public_html/links/include/mcrypt-functions.php:24) in /home/*****/public_html/links/index.php on line 168
This message stops the page drom redirecting successfully and i get a blank page with the warning.
How can i stop this error?
Thanks.