View Full Version : when re-directing do I loose my variables ?

03-04-2009, 06:12 AM

I have an error message in one script and its not getting through to
the display script. Is this because it goes through a redirect ?


if ($num == 0 ) {
$err_mes = "There an ERROR in locatiing this product.";
if (@$_SESSION['guru'] == "Geldi"){
require_once ("exp_control.php");
} // endif

Then in "exp_control.php" I have:

if (@$_SESSION['guru'] != "Geldi"){
header("Location: /im/mem_start1.php");
} // end if

In "mem_start1.php" I have:

if( isset($err_mes)){
if($err_mes != ""){
echo "<div style='position:absolute; top:250px; left:700px; color : red;' >
Error<b><blink>:</blink></b> $err_mes</div>";
} // end if
} // end if

But I don't get the error message.

Is the redirect dropping the variable ?

03-04-2009, 08:24 AM
Put simply, yes. Use the $_SESSION array or a query string on the URL to pass things along.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum