Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sessions & header("location: file.php") HELP!

Status
Not open for further replies.

Naits

Programmer
Oct 10, 2001
90
0
0
NO
I'm having trouble using the header("location: file.php") when I'm using session. This is some of the code:

if ($password == $data['password']) {
session_start();
$_SESSION["userID"] = $data['id'];
echo "Password accepted";
header("location: manager.php");
}

But that giving me an error msg that says that he can't add header info because it's alredy set at the "session_start" line.

Is there any way to make this work?

Thanks! __________________
Visit my homepage
.: Game universE :.
 
this line echo "Password accepted"; will force the page to send basic headers.

The header() function should be the first thing sent to the browser. ***************************************
Party on, dudes!
[cannon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top