...

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



jeddi
03-04-2009, 07:12 AM
Hi,

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 ?

EG


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");
exit();
} // 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 ?

Fumigator
03-04-2009, 09: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