Globals with require()

From: Date: Fri, 04 Aug 2000 09:19:57 +0000
Subject: Globals with require()
Groups: php.general 
Request: Send a blank email to php-general+get-10096@lists.php.net to get a copy of this message
Thanks for asking Sam, maybe it means it's serious ? Anyway it is serious for me .. ;) Please see update at bottom:
From: "Sam Masiello" <smasiello@chekinc.com> To: "XFred ."Xfred_1@hotmail.com>, <php-general@lists.php.net> >Subject: RE: [PHP] using globals in require() Date: Thu, 3 Aug 2000 08:48:21 -0400 Could you please provide how you are setting some of these variables within your globals.php3 file, and also how you are using these values within the functions that are referencing it? Sam Masiello System Analyst Chek.Com (716) 853-1362 x289 smasiello@chekinc.com Hi, I have troubles using previously defined globals in a require()ed file exemple:
-----main file------------ <? require("globals.php3"); require("IB_fcts.php3"); //valid script follows .. ?> ----globals.php3------- <? $gsp="/usr/interbase/bases/gsp.gdb"; ?> ----IB_fcts.php3------ <? $conn=ibase_connect($gsp,$user_id,$user_pwd); // $user_id and $user_pwd are passed to the main file trought the http // request (http://path/main.php3?user_id="login"&user_pwd="kryptedpass") //neither of these 3 globals have a value in IB_fcts.php3 . function my_fct() { global $user_id; echo $user_id; // no output .. } ?> I would be grateful to anyone who could help .. thx. ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

« previous php.general (#10096) next »