note 35239 deleted from function.import-request-variables by vincent

From: Date: Mon, 25 Aug 2003 07:19:00 +0000
Subject: note 35239 deleted from function.import-request-variables by vincent
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-55022@lists.php.net to get a copy of this message
Note Submitter: pulstar@ig.com.br ---- To use this constructor, you will need to call it AFTER the ob_start(), or your session variables will be replaced by external variables. See the examples below: <?php // the wrong way import_request_variables("GPC"); echo "bar = ",$bar,"<br>"; session_start(); if(!isset($bar)) { session_register("bar"); $bar=111; } echo "bar = ",$bar,"<br>"; echo "<a href='",basename($PHP_SELF),"?bar=222'>Clique here</a>"; ?> Edemilson Lima <?php // the right way session_start(); if(!isset($foo)) { session_register("foo"); $foo=111; } echo "foo = ",$foo,"<br>"; import_request_variables("GPC"); echo "foo = ",$foo,"<br>"; echo "<a href='",basename($PHP_SELF),"?for=222'>Clique here</a>"; ?>

« previous php.notes (#55022) next »