I'm seeing a problem that has me flummoxed. The only thing I can
think of is that I'm violating some rule I don't know about.
I have some code that does some processing and then does a
header('Locatio n: ...) jump to page A on success or falls through to
the jump to page B. This is the code:
if ( mysql_query( 'LOCK TABLES tableX WRITE', $link ) )
{
mysql_query( $q, $link ) ; // store the record
$ID = mysql_insert_id ( $link ) ; // save the new id
if ( mysql_affected_ rows($link) == 1 )
{
unlock_tables() ;
$_SESSION['ErrMsg'] = 'New ID is ' . $ID ;
header( 'Location: PageA.php' ) ;
$_SESSION['ErrMsg'] .= ' Error: ignored jump' ;
}
else // the store failed
{ error handling }
}
// second chance (for debugging) to do the right thing
header( 'Location: PageA.php' ) ;
$_SESSION['ErrMsg'] .= ' and it ignored it AGAIN!' ;
// and we shouldn't get here at all -- but we do!
header( 'Location: PageB.php ) ;
Unfortunately, as I know from the telltales I stuff into session, the
store works but the interpreter ignores both header calls that would
jump to A and finally jumps to B instead. Unless I'm more tired than
I'm aware, or more ignorant, this doesn't make sense.
Any straw gratefully clutched.
Margaret
--
(To mail me, please change .not.invalid to .net, first.
Apologies for the inconvenience.)
think of is that I'm violating some rule I don't know about.
I have some code that does some processing and then does a
header('Locatio n: ...) jump to page A on success or falls through to
the jump to page B. This is the code:
if ( mysql_query( 'LOCK TABLES tableX WRITE', $link ) )
{
mysql_query( $q, $link ) ; // store the record
$ID = mysql_insert_id ( $link ) ; // save the new id
if ( mysql_affected_ rows($link) == 1 )
{
unlock_tables() ;
$_SESSION['ErrMsg'] = 'New ID is ' . $ID ;
header( 'Location: PageA.php' ) ;
$_SESSION['ErrMsg'] .= ' Error: ignored jump' ;
}
else // the store failed
{ error handling }
}
// second chance (for debugging) to do the right thing
header( 'Location: PageA.php' ) ;
$_SESSION['ErrMsg'] .= ' and it ignored it AGAIN!' ;
// and we shouldn't get here at all -- but we do!
header( 'Location: PageB.php ) ;
Unfortunately, as I know from the telltales I stuff into session, the
store works but the interpreter ignores both header calls that would
jump to A and finally jumps to B instead. Unless I'm more tired than
I'm aware, or more ignorant, this doesn't make sense.
Any straw gratefully clutched.
Margaret
--
(To mail me, please change .not.invalid to .net, first.
Apologies for the inconvenience.)
Comment