Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id BD0024759FA for ; Wed, 29 May 2002 10:53:27 -0400 (EDT) Received: from virtual1.giganet.nl (tarantula.giganet.nl [212.125.143.1]) by postgresql.org (Postfix) with ESMTP id 32F45475910 for ; Wed, 29 May 2002 10:53:25 -0400 (EDT) Received: from artemis.cuci.nl (artemis.cuci.nl [212.125.128.9]) by virtual1.giganet.nl (BuGless_3.01) with ESMTP id g4TErS630049 for ; Wed, 29 May 2002 16:53:28 +0200 Received: from adlsa (adlsa.cm.cuci.nl [10.1.12.174]) by artemis.cuci.nl (BuGless_3.01) with ESMTP id g4TErRFP005339 for ; Wed, 29 May 2002 16:53:28 +0200 Message-Id: <200205291453.g4TErRFP005339@artemis.cuci.nl> Received: from Spooler by adlsa (Mercury/32 v3.31) ID MO0004F1; 29 May 02 16:55:13 +0200 Received: from spooler by arbodienst-limburg.nl (Mercury/32 v3.31); 29 May 02 16:46:35 +0200 From: "Jules Alberts" Organization: ARBOdienst Limburg BV To: pgsql-php@postgresql.org Date: Wed, 29 May 2002 16:46:15 +0200 MIME-Version: 1.0 Subject: variable visibility when using Reply-To: jules.alberts@arbodienst-limburg.nl X-mailer: Pegasus Mail for Windows (v4.01) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Archive-Number: 200205/106 X-Sequence-Number: 1238 hello world, sorry if this is off topic, but the question arose when i was buidling a test system with PHP4 / postgresql. i want a user to enter a user ID and password in order to make a non- permanent database connection. so the application (that consistes of several PHP and HTML files) should remember the values in variables. a logical approach seemed to be global variables, however, this doesn't work when new pages are generated. in this small example: // this is file main.php "; $password="fubar"; echo "password is: \"$password\"
"; echo "sub"; echo ""; ?> // this is file sub.php "; global $password; // doesn't work echo "password is: \"$password\"
"; echo ""; ?> the variable $password is not visible in sub.php. i guess this is because the href link creates a new page, a fresh start. still i want $password to be visible in sub.php. what is a good, safe way to do this? setting serverside environment variables sounds dangerous. and i would like to avoid cookies (unless it's the only way). i thought about include_once(), but you can't call that from a link. or can you? how is this normally done? TIA for any tips! -- Jules Alberts