Sunday, 18 August 2013

PHP : can someone explain me what`s header function actually does?

PHP : can someone explain me what`s header function actually does?

can someone explain me whats header function actually does? ilooked for
php manual but that was not clear to me so i actually didnt understand
what is header function infact and for what purposes used.. Thank u in
advance..here the function whichs i should digest..
function ofunc_startusr ($GETID="_usrid_",$FORCE=false)
{
$a = explode(".",$_SERVER["SERVER_NAME"]);
$dom =".".$a[(count($a)-2)].".".$a[(count($a)-1)];
if($GETID!==false && isset($_GET[$GETID]) && $_GET[$GETID])
{
session_set_cookie_params(0,"/",$dom);
session_id($_GET[$GETID]);
session_name("_usr_");
session_start();
header("Location: ".($_SERVER["REDIRECT_URL"]?
$_SERVER["REDIRECT_URL"]:"/"));
exit;
}
elseif($FORCE || (isset($_COOKIE["_usr_"]) && $_COOKIE["_usr_"]))
{
session_set_cookie_params(0,"/",$dom);
session_name("_usr_");
session_start();
return true;
}
return false;
}

No comments:

Post a Comment