Re: headers and session (question)

From: Date: Mon, 06 Jun 2005 21:09:10 +0000
Subject: Re: headers and session (question)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-216519@lists.php.net to get a copy of this message
* "Alessandro Rosa" <zandor_zz@yahoo.it>: > Here's below the solution (the encryption will be shortly performed > into login.php). > > 1 <?php > 2 session_start(); > > 3 $_SESSION['session_user'] = $_POST['txtIdUtente']; > 4 $_SESSION['session_password'] = $_POST['txtPassword']; > > 5 $PHPcmd = "login.php" ; > > 6 header( "Location: ".$PHPcmd ); > 7 ?> > > > But a QUESTION now : > > if line 5 is replaced by these two lines, say here 5a and 5b: > > 5a require_once("config.inc.php"); > 5b $PHPcmd = $GLOBALS['gestionale_path_name']."phpcode/login/login.php" ; > > this does not work (meaning user and psw are not passed to login.php); > but again the below code works again: > > 5a require_once("config.inc.php"); > 5b $PHPcmd = $gestionale_path_name."phpcode/login/login.php" ; Again, look at your config.inc.php and make sure it's not sending any output. If you have even a blank line before an opening <?php tag or a blank line following, output will have been sent, and you will not be able to send a cookie or additional HTTP headers. -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association | http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:matthew@garden.org | http://vermontbotanical.org

« previous php.general (#216519) next »