[PHP] Re: Globals set to off - Sessions

2003-10-27 Thread pete M
function check_admin_user() { //global $admin_user; // if ( (session_is_registered(admin_user)) (isset($admin_user)) ) if ( isset($_SESSION['admin_user']) ) return true; else return false; } Steve Jackson wrote: I am not sure what I have to do in order to control sessions in PHP

[PHP] Re: Globals

2003-08-01 Thread Greg Beaver
Hi Chris, Chris Boget wrote: function blah() { //global $GLOBALS; echo 'Globals: pre'; print_r( $GLOBALS ); echo '/pre'; } As it is shown above, with the 'global $GLOBALS' line commented out, the print_r() works and shows all the currently defined variables and their corresponding values.

Re: [PHP] Re: Globals

2003-08-01 Thread Leif K-Brooks
Greg Beaver wrote: $GLOBALS does not contain a reference to itself Yes it does. I just ran the following, and I got Greg is wrong. ?php $foo = 'Greg is wrong.'; echo $GLOBALS['GLOBALS']['GLOBALS']['GLOBALS']['foo']; ? -- The above message is encrypted with double rot13 encoding. Any

Re: [PHP] Re: Globals

2003-08-01 Thread Greg Beaver
Try this code: ?php function blah() { var_dump($GLOBALS['GLOBALS']); } blah(); ? It appears that in a function scope, it doesn't. This is definitely a bug, I'll post it if it hasn't already been noticed. Greg Leif K-Brooks wrote: Greg Beaver wrote: $GLOBALS does not contain a reference to

Re: [PHP] Re: Globals

2003-08-01 Thread Jim Lucas
] Sent: Friday, August 01, 2003 12:45 PM Subject: Re: [PHP] Re: Globals Try this code: ?php function blah() { var_dump($GLOBALS['GLOBALS']); } blah(); ? It appears that in a function scope, it doesn't. This is definitely a bug, I'll post it if it hasn't already been noticed

Re: [PHP] Re: Globals

2003-08-01 Thread Greg Beaver
Subject: Re: [PHP] Re: Globals Try this code: ?php function blah() { var_dump($GLOBALS['GLOBALS']); } blah(); ? It appears that in a function scope, it doesn't. This is definitely a bug, I'll post it if it hasn't already been noticed. Greg Leif K-Brooks wrote: Greg Beaver wrote

Re: [PHP] Re: Globals

2003-08-01 Thread Jim Lucas
: [EMAIL PROTECTED] Sent: Friday, August 01, 2003 12:45 PM Subject: Re: [PHP] Re: Globals Try this code: ?php function blah() { var_dump($GLOBALS['GLOBALS']); } blah(); ? It appears that in a function scope, it doesn't. This is definitely a bug, I'll post it if it hasn't

Re: [PHP] Re: Globals

2003-08-01 Thread Greg Beaver
: Leif K-Brooks [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, August 01, 2003 1:42 PM Subject: Re: [PHP] Re: Globals Hi Jim, The code you posted is correct, I never contested that. Read carefully. ?php function not_super() { var_dump(isset($GLOBALS['GLOBALS'])); $a = array_keys($GLOBALS

Re: [PHP] Re: Globals

2003-08-01 Thread Jim Lucas
this??? And why??? Jim - Original Message - From: Greg Beaver [EMAIL PROTECTED] To: Jim Lucas [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, August 01, 2003 2:43 PM Subject: Re: [PHP] Re: Globals Jim, My bad, I posted the wrong code. Try this instead to see the bug: ?php

Re: [PHP] Re: Globals

2003-08-01 Thread Greg Beaver
, 2003 2:43 PM Subject: Re: [PHP] Re: Globals Jim, My bad, I posted the wrong code. Try this instead to see the bug: ?php function not_super() { var_dump(isset($GLOBALS['GLOBALS'])); return array_keys($GLOBALS); } //var_dump(not_super(), array_keys($GLOBALS)); not_super(); not_super

Re: [PHP] Re: Globals

2003-08-01 Thread Jim Lucas
I am running PHP 4.2.2 on Debian linux with apache 1.3.26 Jim - Original Message - From: Greg Beaver To: Jim Lucas Cc: [EMAIL PROTECTED] Sent: Friday, August 01, 2003 3:02 PM Subject: Re: [PHP] Re: Globals What version of PHP are you running? I have PHP 4.3.2

[PHP] Re: globals off in function

2003-01-14 Thread Foong
instead of: global $smarty; $smarty]-assign(message, $message); try: $_GLOBAL['smarty']-assign(message, $message); Foong Michael Bevz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, all!!! I've such trouble: ( register_globals = off ) in function i

Re: [PHP] Re: globals in functions

2002-04-14 Thread Philip Olson
Is there an easier way than having to manually place global in each function...?? It's not that hard :) Other than passing by parameter? Like is it possible to actually declare var's in PHP as global? No. Consider arrays, constants, extract(), etc. Regards, Philip -- PHP

[PHP] Re: globals in functions

2002-04-13 Thread phplists
function someCommand() { global $var1, $var2, $var3; stuff(); } I think you could also use define(); maybe.. Later, Bob Weaver Paul Roberts [EMAIL PROTECTED] wrote in message 00f301c1e311$fa421af0$dde5883e@laptop1">news:00f301c1e311$fa421af0$dde5883e@laptop1... Is there a quick way to

[PHP] Re: globals in functions

2002-04-13 Thread The_RadiX
Just one thing... Is there an easier way than having to manually place global in each function...?? Other than passing by parameter? Like is it possible to actually declare var's in PHP as global? thx.. ::: Julien Bonastre

[PHP] Re: $GLOBALS array

2001-12-23 Thread Gaylen Fraley
Why aren't you using the $_POST or $HTTP_POST_VARS array? -- Gaylen [EMAIL PROTECTED] Home http://www.gaylenandmargie.com/ PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite/ Philip Maciver [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Does

Re: [PHP] Re: $GLOBALS array

2001-12-23 Thread Philip MacIver
Basically I use the MVC (Model View Controller) architecture when building my php scripts. So all of my logic is handled by a controller which calls methods on functions, that way the php scritps that are used to display forms, tables etc. have little to no business logic to them at all. Now

[PHP] Re: Globals and HTTP_SESSION_VARS variables.

2001-10-02 Thread Richard Lynch
You should be able to compare $var with $HTTP_SESSIN_VARS['var'] to figure out what you want... -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: