Hi, everybody:
I have written an include file in my php file "main.php", with and include "ip.php", which is:
<?php
function getRealIpAddr()
{
if (!empty($_SERVER)){ //check ip from share internet
$ip=$_SERVER;
}
elseif (!empty($_SERVER)){ //to check ip is pass from proxy
$ip=$_SERVER;
}
else{
$ip=$_SERVER;
}
return $ip;
}
?>
My "main.php" is:
<?php
include("ip.php");
...
setcookie("US", $one.$two, $expire);
...
>
When I execute it, the "setcookie" gives me the error: "Warning: Cannot modify header information - headers already sent by (output started at .../ip.php:21) in .../main.php on line 402"
The header is supposed to be set in line 21, but line 21 does not exist!!!
Any help?
Thank you,
Xagutxu