Re: Problem Directing the Page with header

From: Date: Fri, 16 Feb 2007 08:27:02 +0000
Subject: Re: Problem Directing the Page with header
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-248948@lists.php.net to get a copy of this message
2007. 02. 15, csütörtök keltezéssel 18.41-kor Ashish Rizal ezt írta: > 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"); it says you sent out some output on line 1 what is on line 1? maybe you have a blank line in the beginning of your php file? greets Zoltán Németh > > 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. >

« previous php.general (#248948) next »