hi ,
i'm checking for the username if it is "usama" then i'm simply redirecting it to login page but it's not working .... it simply prints the user name and warnings ...
the out put of the this php code is
......................OUT_PUT..............................................
usama
Warning: Cannot modify header information - headers already sent by (output started at G:\MS Publishers\Login_test.php:4) in G:\MS Publishers\Login_test.php on line 7
PHP Warning: Cannot modify header information - headers already sent by (output started at G:\MS Publishers\Login_test.php:4) in G:\MS Publishers\Login_test.php on line 7
//..............................................................................
here is the code ....
//////////////////////////////////////////////////////////////////
<?php
require 'functions.php';
echo($DB_LOGIN);
// Check whether the user is already authenticated or not
if($DB_LOGIN=="usama"){
header("Location: http://localhost/default.htm",false);
$DB_LOGIN="";
exit;
}
else if(!authenticateUser( $cookie_user, $cookie_passwd)){
header("Location:http://localhost/display.php");
exit();
}
?>
////////////
i'm using winxp with IIS 5
what is the wrong i'm doing ... Can any budy tell...
Noman.
Can any body tell what wqrong i'm doing !
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Have you read:
viewtopic.php?t=1157
That echo statement:
is output.
Mac
viewtopic.php?t=1157
That echo statement:
Code: Select all
echo($DB_LOGIN);Mac
you can't have any output before a header-command.
Your code should be working if you modify it likes this:
Your code should be working if you modify it likes this:
Code: Select all
<?php
<?php
require 'functions.php';
//echo($DB_LOGIN);
// Check whether the user is already authenticated or not
if($DB_LOGIN=="usama"){
header("Location: http://localhost/default.htm",false);
$DB_LOGIN="";
exit;
}
else if(!authenticateUser( $cookie_user, $cookie_passwd)){
header("Location:http://localhost/display.php");
exit();
}
?>
?>