Jump to content

header() functino failure !!!!!


halm1985

Recommended Posts

Becuase there has been an output to the page before (such as an error) but if *anything* is sent to the browser then the header function wont work

 

for example:

 

echo "hello";
header("Location: somepage.php");

 

that wont work,. however this will:

 

header("Location: somepage.php");

 

the reason is that php has sent out the headers already, and it cannto do it again.

ok, but the problem still exists

 

here's the case

 

i have the following defined function in header.php file

 

 

<?php

# AUTENTICATE
function authenticate($realm = "WBGRS", $errmsg)
{

header("WWW-Authenticate : Basic realm = \"$realm\"");
header("HTTP/1.0 401 Unauthorized");
die ($errmsg);

}

 

and i need to call this function after including this HEADER.PHP page in another one ?? how can that be done ??

 

ABOUT THE OBSTART() function .. it didn't work .. what should the supplied arguments be ?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.