Header problem

Header problem

am 20.05.2002 11:33:10 von arun kv

Hello Sir,
I am designing login page for user authentication.

Here is my sample code:
index.php



Username name="username">
Password




login.php

// login.php - performs validation
// authenticate using form variables
$status = authenticate($username,$password);//function which returns an
//integer either 0 or 1
// if user/pass combination is correct

if ($status == 1)
{
// initiate a session
session_start();
// register some session variables
session_register("SESSION");
// including the username
session_register("SESSION_UNAME");
$SESSION_UNAME = $username;
// redirect to protected page
header("Location: /securejlt.php");
exit();
}

When I enter username and password in index.php and give submit, am
getting the error "headers already sent".
The manual says that wwe should not have any echo statement before
header statement. I am not using any echo or print statement before header
function is called in my login.php.
I am not able to make out what the problem with my code.

Please help me out in this problem

Regards,
Arun


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Re: Header problem

am 20.05.2002 13:36:10 von duncan.adams

u'r header must be before any thing that u send to the web browser

i had this problem with a space that i had right at the top of my page just
before the
-----Original Message-----
From: arun kv [mailto:arun@library.iisc.ernet.in]
Sent: Monday, May 20, 2002 11:33 AM
To: PGSQL
Subject: [PHP] Header problem


Hello Sir,
I am designing login page for user authentication.

Here is my sample code:
index.php



Username name="username">
Password




login.php

// login.php - performs validation
// authenticate using form variables
$status = authenticate($username,$password);//function which returns an
//integer either 0 or 1
// if user/pass combination is correct

if ($status == 1)
{
// initiate a session
session_start();
// register some session variables
session_register("SESSION");
// including the username
session_register("SESSION_UNAME");
$SESSION_UNAME = $username;
// redirect to protected page
header("Location: /securejlt.php");
exit();
}

When I enter username and password in index.php and give submit, am
getting the error "headers already sent".
The manual says that wwe should not have any echo statement before
header statement. I am not using any echo or print statement before header
function is called in my login.php.
I am not able to make out what the problem with my code.

Please help me out in this problem

Regards,
Arun


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster