Received: from hapcibeno.freestart.hu (hapcibeno.freestart.hu [213.197.64.8]) by postgresql.org (Postfix) with ESMTP id 4C4384758DE for ; Tue, 23 Apr 2002 08:47:12 -0400 (EDT) Received: from line-71-113.dial.freestart.hu ([213.197.71.113] helo=jaguar) by freestart.hu with smtp (Freestart relay 2 (FS-Lin)) id 16zzpY-00072L-00; Tue, 23 Apr 2002 14:55:36 +0200 Message-ID: <001501c1eac5$51a4db60$01fdfea9@jaguar> Reply-To: "Papp, Gyozo" From: "Papp, Gyozo" To: , References: <200204230643.g3N6hEQw020907@artemis.cuci.nl> <200204231033.g3NAX9Qw028301@artemis.cuci.nl> Subject: Re: global variable problem Date: Tue, 23 Apr 2002 13:12:21 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Scanner: exiscan by Freestart X-Archive-Number: 200204/83 X-Sequence-Number: 1107 hi, =20 | > The script ends when the .php file reach it's end( when there is noting | > more to parse/ and or execute ). in general this is the case. If you must do somethign after all output sent= to=20 the browser you can register one or more shutdown function to process in hi= de. But it's not so common. | i have a feeling it's more complex than that. a script calls itself,=20 | rebuilds HTML code. has the script ended or not? the script that did=20 It's up to at all. | the call has ended. but since it has called itself, it hasn't. i find=20 | these recursion matters a bit vague when it comes to scipts that=20 | generate themselves. Tere is no recursion, it's a different thing. You can avoid it with some so called state variable. switch ($status){ case 'BUILD_FORM_FIRST': case 'CHECK_FORM': case 'SHOW_RESULT': } |=20 | > > - why is the variable $conn visible in start(), but not in listing()? | >=20 | > If you want to have access to a global var. inside of a function, you | > must say that the global var. is global. Ex: |=20 | i did that, it doesn't make any difference =20 I'm afraid that you didn't reopen the connection in show.php.=20 you must initialize each variable in each separate page, because each script is a totally independent program from each other. SESSION can ease your work but resources such as connection, result sets, cannot be registered in a=20 session. | > doing a roolback in this connection, doest it will roolback all scripts? No, at the end of the script PHP sends a ROLLBACK automatically to=20 postgres. So it can rollback the queries in the actual request (page) only.