Re: Session not working?

From: Date: Mon, 09 Jun 2003 19:16:51 +0000
Subject: Re: Session not working?
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-150793@lists.php.net to get a copy of this message
On Mon, Jun 09, 2003 at 09:01:49PM +0200, Frank Keessen wrote: > The orignal code was in the first mail; again; > > $_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:""; > if($_REQUEST['submit']!="") > { > $dater=$_POST['$dater']; > $aantalvol=$_POST['$aantalvol']; > $aantalkind=$_POST['$aantalkind']; > $aantalvol=addslashes($_POST['aantalvol']); > session_start(); > $_SESSION['dater'] = $dater; > $_SESSION['aantalvol'] = $aantalvol; > $_SESSION['aantalkind'] = $aantalkind; > $_SESSION['1pk'] = $eenpk; > $_SESSION['2pk'] = $tweepk; > > header( "Location: test3.php" ); > } > > test3.php > > <? > session_start(); > echo $_SESSION['aantalvol']; > ?> It looks to me like you must have an error somewhere else. I pasted this PHP into a blank page and then tested it with: http://localhost/testing/test.php?submit=you the page correctly re-directed to test3.php The header() function can ONLY re-direct the browser to another page if *nothing* else has been printed/echoed to the browser. Can you check to make sure that this is the very first thing that is called on the page? emma -- Emma Jane Hogbin [[ 416 417 2868 ][ www.xtrinsic.com ]]

« previous php.general (#150793) next »