#19157 [NEW]: Location not working

From: Date: Wed, 28 Aug 2002 19:07:21 +0000
Subject: #19157 [NEW]: Location not working
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18082@lists.php.net to get a copy of this message
From: shelley@databyte.com Operating system: w2k server PHP version: 4.2.2 PHP Bug Type: Session related Bug description: Location not working The header("Location only works 1/3 of the time. I had the same problem on PHP 4.2.1 so I upgraded to 4.2.2 to see if it fixed the problem, and it doesn't. I'm using Zend and I tried this program without using Zend same results. The Location command only works 1/3 of the time the other times I get an CGI error msg. I need this ASAP we are working on a major project and this is holding us up. include_once("defaults.inc"); include_once("passfunc.inc"); $tst=headers_sent(); include_once("config.inc"); include_once("conn.inc"); $tst=headers_sent(); include_once("ecom_errors.inc"); $tst=headers_sent(); session_start(); $sess_key=session_id(); $tst=headers_sent(); // $gsess_key="'".$sess_key."'"; $access = 'grant'; $page_name='page1.php'; $login='shelley'; $HTTP_SESSION_VARS['saccess'] = $access; $HTTP_SESSION_VARS['susername'] = 'Shelley Jones'; $HTTP_SESSION_VARS['suserid'] = $login; $HTTP_SESSION_VARS['suseris'] = 'Cust'; $HTTP_SESSION_VARS['spage'] = $page_name; $tst=headers_sent(); $g_url="Location:http://localhost/php/page2.php?K="."'".$sess_key."'"; redirect2($g_url); exit; This is the redirect function: <? // passfunc.inc function redirect2($url){ header($url); flush(); } ?> Shelley -- Edit bug report at http://bugs.php.net/?id=19157&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=19157&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=19157&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=19157&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=19157&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=19157&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=19157&r=support Expected behavior: http://bugs.php.net/fix.php?id=19157&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=19157&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=19157&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=19157&r=globals

« previous php.bugs (#18082) next »