Re: Problem Directing the Page with header
| From: | Ashish Rizal | Date: | Thu, 15 Feb 2007 23:41:13 +0000 |
| Subject: | Re: Problem Directing the Page with header | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-248939@lists.php.net to get a copy of this message | ||
Hey Jim,
Thanks for the quick response. I have actually made the whole
code on same page (login.php) and the functions that i used in
this code are in functions.php. Now this time it is showing the
warning :
Warning: Cannot modify header information - headers already sent
by (output started at C:\Program
Files\xampp\htdocs\fselection\login.php:1) in C:\Program
Files\xampp\htdocs\fselection\login.php on line 19
The line 19 is header("Location: http://$host$uri/$extra");
Below is the list of code for login.php.
The Server i am using is SunOS 5.10.
<?php
session_start();
require_once 'functions.php';
$UserName = $_POST['UserName'];
$Password = $_POST['Password'];
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'adminlogin.php';
$loc = "\"http://$host$uri/$extra\"";
if ($_POST){
$error = login_check($_POST);
if (trim ($error)=="")
{
$accesslevel = accessLevel($UserName);
?>
<?php
if ($accesslevel == "admin"){
$_SESSION["userid"] = login($_POST);
header("Location: http://$host$uri/$extra");
exit();
}
else if ($accesslevel == "user") {
//echo "this is user";
$_SESSION["userid"] = login($_POST);
header('Location: userlogin.php');
exit();
}
}
else {
print "Error :$error";
}
}
?>
<BODY>
<FORM id=form1 name=loginform method=post>
<TABLE align=center> ........
***********************Login Form Goes Here **********
nothing php Stuffs on this part
</body>
Thank you again for your time and consideration.